Rename method and attribute, and remove unnecessary attribute filtering

This commit is contained in:
Clark Winkelmann 2018-01-11 23:05:26 +01:00
parent 324616728e
commit 2797eaff9a
2 changed files with 5 additions and 6 deletions

View File

@ -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 {
<input className="FormControl" name="username" type="text" placeholder={extractText(app.translator.trans('core.forum.sign_up.username_placeholder'))}
value={this.username()}
onchange={m.withAttr('value', this.username)}
disabled={this.loading || this.fieldCantBeEdited('username')} />
disabled={this.loading || this.isProvided('username')} />
</div>
<div className="Form-group">
<input className="FormControl" name="email" type="email" placeholder={extractText(app.translator.trans('core.forum.sign_up.email_placeholder'))}
value={this.email()}
onchange={m.withAttr('value', this.email)}
disabled={this.loading || this.fieldCantBeEdited('email')} />
disabled={this.loading || this.isProvided('email')} />
</div>
{this.props.token ? '' : (

View File

@ -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)]
);
}