mirror of
https://github.com/flarum/core.git
synced 2025-08-02 06:30:53 +02:00
Rename method and attribute, and remove unnecessary attribute filtering
This commit is contained in:
@@ -60,8 +60,8 @@ export default class SignUpModal extends Modal {
|
|||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
fieldCantBeEdited(field) {
|
isProvided(field) {
|
||||||
return this.props.identification_fields && this.props.identification_fields.indexOf(field) !== -1;
|
return this.props.identificationFields && this.props.identificationFields.indexOf(field) !== -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
body() {
|
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'))}
|
<input className="FormControl" name="username" type="text" placeholder={extractText(app.translator.trans('core.forum.sign_up.username_placeholder'))}
|
||||||
value={this.username()}
|
value={this.username()}
|
||||||
onchange={m.withAttr('value', this.username)}
|
onchange={m.withAttr('value', this.username)}
|
||||||
disabled={this.loading || this.fieldCantBeEdited('username')} />
|
disabled={this.loading || this.isProvided('username')} />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="Form-group">
|
<div className="Form-group">
|
||||||
<input className="FormControl" name="email" type="email" placeholder={extractText(app.translator.trans('core.forum.sign_up.email_placeholder'))}
|
<input className="FormControl" name="email" type="email" placeholder={extractText(app.translator.trans('core.forum.sign_up.email_placeholder'))}
|
||||||
value={this.email()}
|
value={this.email()}
|
||||||
onchange={m.withAttr('value', this.email)}
|
onchange={m.withAttr('value', this.email)}
|
||||||
disabled={this.loading || this.fieldCantBeEdited('email')} />
|
disabled={this.loading || this.isProvided('email')} />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{this.props.token ? '' : (
|
{this.props.token ? '' : (
|
||||||
|
@@ -109,8 +109,7 @@ class AuthenticationResponseFactory
|
|||||||
$suggestions,
|
$suggestions,
|
||||||
['token' => $token->id],
|
['token' => $token->id],
|
||||||
// List of the fields that can't be edited during sign up
|
// 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
|
['identificationFields' => array_keys($identification)]
|
||||||
['identification_fields' => array_keys(array_only($identification, ['username', 'email']))]
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user