diff --git a/js/forum/src/components/SignUpModal.js b/js/forum/src/components/SignUpModal.js
index ed0c1362e..fa96c80c0 100644
--- a/js/forum/src/components/SignUpModal.js
+++ b/js/forum/src/components/SignUpModal.js
@@ -60,6 +60,10 @@ export default class SignUpModal extends Modal {
];
}
+ isProvided(field) {
+ return this.props.identificationFields && this.props.identificationFields.indexOf(field) !== -1;
+ }
+
body() {
return [
this.props.token ? '' : ,
@@ -69,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 90efc1771..6a17c8c2d 100644
--- a/src/Forum/AuthenticationResponseFactory.php
+++ b/src/Forum/AuthenticationResponseFactory.php
@@ -104,7 +104,13 @@ class AuthenticationResponseFactory
$token = AuthToken::generate($identification);
$token->save();
- $payload = array_merge($identification, $suggestions, ['token' => $token->id]);
+ $payload = array_merge(
+ $identification,
+ $suggestions,
+ ['token' => $token->id],
+ // List of the fields that can't be edited during sign up
+ ['identificationFields' => array_keys($identification)]
+ );
}
return $payload;