summaryrefslogtreecommitdiffstats
path: root/web/react/components/signup_user_complete.jsx
diff options
context:
space:
mode:
authorChristopher Speller <crspeller@gmail.com>2015-10-06 08:41:49 -0400
committerChristopher Speller <crspeller@gmail.com>2015-10-06 08:41:49 -0400
commit91e55e2829761cb504d2f349a79bc3e1481ab039 (patch)
treeefecabdcf9a75d449e4714bba99892c32afbb106 /web/react/components/signup_user_complete.jsx
parent7505a80bcb32f224de03d441696fd7e87817a7bd (diff)
downloadchat-91e55e2829761cb504d2f349a79bc3e1481ab039.tar.gz
chat-91e55e2829761cb504d2f349a79bc3e1481ab039.tar.bz2
chat-91e55e2829761cb504d2f349a79bc3e1481ab039.zip
Fixing broken signup page
Diffstat (limited to 'web/react/components/signup_user_complete.jsx')
-rw-r--r--web/react/components/signup_user_complete.jsx27
1 files changed, 14 insertions, 13 deletions
diff --git a/web/react/components/signup_user_complete.jsx b/web/react/components/signup_user_complete.jsx
index ae3075495..4e17c6d06 100644
--- a/web/react/components/signup_user_complete.jsx
+++ b/web/react/components/signup_user_complete.jsx
@@ -20,8 +20,6 @@ export default class SignupUserComplete extends React.Component {
initialState.user = {};
initialState.user.team_id = this.props.teamId;
initialState.user.email = this.props.email;
- initialState.hash = this.props.hash;
- initialState.data = this.props.data;
initialState.original_email = this.props.email;
}
@@ -47,7 +45,7 @@ export default class SignupUserComplete extends React.Component {
return;
}
- const usernameError = Utils.isValidUsername(this.state.user.username);
+ const usernameError = Utils.isValidUsername(providedUsername);
if (usernameError === 'Cannot use a reserved word as a username.') {
this.setState({nameError: 'This username is reserved, please choose a new one.', emailError: '', passwordError: '', serverError: ''});
return;
@@ -67,26 +65,29 @@ export default class SignupUserComplete extends React.Component {
return;
}
+ const user = {
+ team_id: this.props.teamId,
+ email: providedEmail,
+ username: providedUsername,
+ password: providedPassword,
+ allow_marketing: true
+ };
+
this.setState({
- user: {
- email: providedEmail,
- username: providedUsername,
- password: providedPassword,
- allow_marketing: true
- },
+ user,
nameError: '',
emailError: '',
passwordError: '',
serverError: ''
});
- client.createUser(this.state.user, this.state.data, this.state.hash,
+ client.createUser(user, this.props.data, this.props.hash,
function createUserSuccess() {
client.track('signup', 'signup_user_02_complete');
- client.loginByEmail(this.props.teamName, this.state.user.email, this.state.user.password,
+ client.loginByEmail(this.props.teamName, user.email, user.password,
function emailLoginSuccess(data) {
- UserStore.setLastEmail(this.state.user.email);
+ UserStore.setLastEmail(user.email);
UserStore.setCurrentUser(data);
if (this.props.hash > 0) {
BrowserStore.setGlobalItem(this.props.hash, JSON.stringify({wizard: 'finished'}));
@@ -95,7 +96,7 @@ export default class SignupUserComplete extends React.Component {
}.bind(this),
function emailLoginFailure(err) {
if (err.message === 'Login failed because email address has not been verified') {
- window.location.href = '/verify_email?email=' + encodeURIComponent(this.state.user.email) + '&teamname=' + encodeURIComponent(this.props.teamName);
+ window.location.href = '/verify_email?email=' + encodeURIComponent(user.email) + '&teamname=' + encodeURIComponent(this.props.teamName);
} else {
this.setState({serverError: err.message});
}