From d3573647126b23cd0ed9f0e69c27466ba8bae255 Mon Sep 17 00:00:00 2001 From: Clark Winkelmann Date: Thu, 11 Jan 2018 23:05:26 +0100 Subject: [PATCH] Rename method and attribute, and remove unnecessary attribute filtering --- js/forum/src/components/SignUpModal.js | 8 ++++---- src/Forum/AuthenticationResponseFactory.php | 3 +-- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/js/forum/src/components/SignUpModal.js b/js/forum/src/components/SignUpModal.js index 3fda244da..fa96c80c0 100644 --- a/js/forum/src/components/SignUpModal.js +++ b/js/forum/src/components/SignUpModal.js @@ -60,8 +60,8 @@ export default class SignUpModal extends Modal { ]; } - fieldCantBeEdited(field) { - return this.props.identification_fields && this.props.identification_fields.indexOf(field) !== -1; + isProvided(field) { + return this.props.identificationFields && this.props.identificationFields.indexOf(field) !== -1; } body() { @@ -73,14 +73,14 @@ export default class SignUpModal extends Modal { + disabled={this.loading || this.isProvided('username')} />
+ disabled={this.loading || this.isProvided('email')} />
{this.props.token ? '' : ( diff --git a/src/Forum/AuthenticationResponseFactory.php b/src/Forum/AuthenticationResponseFactory.php index fbd82c42e..6a17c8c2d 100644 --- a/src/Forum/AuthenticationResponseFactory.php +++ b/src/Forum/AuthenticationResponseFactory.php @@ -109,8 +109,7 @@ class AuthenticationResponseFactory $suggestions, ['token' => $token->id], // List of the fields that can't be edited during sign up - // Only includes attributes on the sign up form, otherwise this could leak private attribute names - ['identification_fields' => array_keys(array_only($identification, ['username', 'email']))] + ['identificationFields' => array_keys($identification)] ); }