summaryrefslogtreecommitdiffstats
path: root/webapp/components/signup_user_complete.jsx
diff options
context:
space:
mode:
Diffstat (limited to 'webapp/components/signup_user_complete.jsx')
-rw-r--r--webapp/components/signup_user_complete.jsx70
1 files changed, 38 insertions, 32 deletions
diff --git a/webapp/components/signup_user_complete.jsx b/webapp/components/signup_user_complete.jsx
index 5c06cefed..ad8b94722 100644
--- a/webapp/components/signup_user_complete.jsx
+++ b/webapp/components/signup_user_complete.jsx
@@ -3,7 +3,9 @@
import FormError from 'components/form_error.jsx';
import LoadingScreen from 'components/loading_screen.jsx';
-import * as GlobalActions from 'action_creators/global_actions.jsx';
+
+import * as GlobalActions from 'actions/global_actions.jsx';
+import {track} from 'actions/analytics_actions.jsx';
import BrowserStore from 'stores/browser_store.jsx';
import UserStore from 'stores/user_store.jsx';
@@ -12,11 +14,10 @@ import * as Utils from 'utils/utils.jsx';
import Client from 'utils/web_client.jsx';
import Constants from 'utils/constants.jsx';
-import {FormattedMessage, FormattedHTMLMessage} from 'react-intl';
-import {browserHistory, Link} from 'react-router';
-
import React from 'react';
import ReactDOM from 'react-dom';
+import {FormattedMessage, FormattedHTMLMessage} from 'react-intl';
+import {browserHistory, Link} from 'react-router';
import logoImage from 'images/logo.png';
@@ -198,6 +199,33 @@ export default class SignupUserComplete extends React.Component {
);
}
+ handleUserCreated(user, data) {
+ track('signup', 'signup_user_02_complete');
+ Client.loginById(
+ data.id,
+ user.password,
+ '',
+ () => {
+ if (this.state.hash > 0) {
+ BrowserStore.setGlobalItem(this.state.hash, JSON.stringify({usedBefore: true}));
+ }
+
+ GlobalActions.emitInitialLoad(
+ () => {
+ browserHistory.push('/select_team');
+ }
+ );
+ },
+ (err) => {
+ if (err.id === 'api.user.login.not_verified.app_error') {
+ browserHistory.push('/should_verify_email?email=' + encodeURIComponent(user.email) + '&teamname=' + encodeURIComponent(this.state.teamName));
+ } else {
+ this.setState({serverError: err.message});
+ }
+ }
+ );
+ }
+
handleSubmit(e) {
e.preventDefault();
@@ -260,7 +288,7 @@ export default class SignupUserComplete extends React.Component {
return;
}
- const providedPassword = ReactDOM.findDOMNode(this.refs.password).value.trim();
+ const providedPassword = ReactDOM.findDOMNode(this.refs.password).value;
if (!providedPassword || providedPassword.length < Constants.MIN_PASSWORD_LENGTH) {
this.setState({
nameError: '',
@@ -296,32 +324,7 @@ export default class SignupUserComplete extends React.Component {
this.state.data,
this.state.hash,
this.state.inviteId,
- (data) => {
- Client.track('signup', 'signup_user_02_complete');
- Client.loginById(
- data.id,
- user.password,
- '',
- () => {
- if (this.state.hash > 0) {
- BrowserStore.setGlobalItem(this.state.hash, JSON.stringify({usedBefore: true}));
- }
-
- GlobalActions.emitInitialLoad(
- () => {
- browserHistory.push('/select_team');
- }
- );
- },
- (err) => {
- if (err.id === 'api.user.login.not_verified.app_error') {
- browserHistory.push('/should_verify_email?email=' + encodeURIComponent(user.email) + '&teamname=' + encodeURIComponent(this.state.teamName));
- } else {
- this.setState({serverError: err.message});
- }
- }
- );
- },
+ this.handleUserCreated.bind(this, user),
(err) => {
this.setState({serverError: err.message});
}
@@ -371,6 +374,7 @@ export default class SignupUserComplete extends React.Component {
onChange={this.handleLdapIdChange}
placeholder={ldapIdPlaceholder}
spellCheck='false'
+ autoCapitalize='off'
/>
</div>
<div className={'form-group' + errorClass}>
@@ -402,7 +406,7 @@ export default class SignupUserComplete extends React.Component {
}
render() {
- Client.track('signup', 'signup_user_01_welcome');
+ track('signup', 'signup_user_01_welcome');
// If we have been used then just display a message
if (this.state.usedBefore) {
@@ -511,6 +515,7 @@ export default class SignupUserComplete extends React.Component {
maxLength='128'
autoFocus={true}
spellCheck='false'
+ autoCapitalize='off'
/>
{emailError}
{emailHelpText}
@@ -594,6 +599,7 @@ export default class SignupUserComplete extends React.Component {
placeholder=''
maxLength={Constants.MAX_USERNAME_LENGTH}
spellCheck='false'
+ autoCapitalize='off'
/>
{nameError}
{nameHelpText}