From 2797eaff9ad3f86e5e9b9d0ec1e5d1035d015853 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 --- framework/core/js/forum/src/components/SignUpModal.js | 8 ++++---- .../core/src/Forum/AuthenticationResponseFactory.php | 3 +-- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/framework/core/js/forum/src/components/SignUpModal.js b/framework/core/js/forum/src/components/SignUpModal.js index 3fda244da..fa96c80c0 100644 --- a/framework/core/js/forum/src/components/SignUpModal.js +++ b/framework/core/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/framework/core/src/Forum/AuthenticationResponseFactory.php b/framework/core/src/Forum/AuthenticationResponseFactory.php index fbd82c42e..6a17c8c2d 100644 --- a/framework/core/src/Forum/AuthenticationResponseFactory.php +++ b/framework/core/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)] ); }