From 18c7e2bc93a46cdfb6ab245f0b366589f7ded9bc Mon Sep 17 00:00:00 2001 From: diminator Date: Wed, 5 Aug 2015 19:22:58 +0200 Subject: [PATCH] invite user with token and signup without email validation --- js/components/ascribe_forms/form_signup.js | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/js/components/ascribe_forms/form_signup.js b/js/components/ascribe_forms/form_signup.js index 238cd74e..91479e4b 100644 --- a/js/components/ascribe_forms/form_signup.js +++ b/js/components/ascribe_forms/form_signup.js @@ -27,7 +27,7 @@ let SignupForm = React.createClass({ children: React.PropTypes.element }, - mixins: [Router.Navigation], + mixins: [Router.Navigation, Router.State], getDefaultProps() { return { @@ -35,7 +35,6 @@ let SignupForm = React.createClass({ submitMessage: getLangText('Sign up') }; }, - getInitialState() { return UserStore.getState(); }, @@ -57,22 +56,32 @@ let SignupForm = React.createClass({ } }, - handleSuccess(response){ - let notification = new GlobalNotificationModel(getLangText('Sign up successful'), 'success', 50000); - GlobalNotificationActions.appendGlobalNotification(notification); - this.props.handleSuccess(getLangText('We sent an email to your address') + ' ' + response.user.email + ', ' + getLangText('please confirm') + '.'); + getFormData() { + return this.getQuery(); + }, + handleSuccess(response){ + if (response.user) { + let notification = new GlobalNotificationModel(getLangText('Sign up successful'), 'success', 50000); + GlobalNotificationActions.appendGlobalNotification(notification); + this.props.handleSuccess(getLangText('We sent an email to your address') + ' ' + response.user.email + ', ' + getLangText('please confirm') + '.'); + } + else if (response.redirect) { + this.transitionTo('pieces'); + } }, render() { let tooltipPassword = getLangText('Your password must be at least 10 characters') + '.\n ' + getLangText('This password is securing your digital property like a bank account') + '.\n ' + getLangText('Store it in a safe place') + '!'; + return (