mirror of
https://github.com/flarum/framework.git
synced 2025-02-21 05:53:37 +08:00
Rename method and attribute, and remove unnecessary attribute filtering
This commit is contained in:
parent
324616728e
commit
2797eaff9a
@ -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 ? '' : (
|
||||
|
@ -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)]
|
||||
);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user