1
0
mirror of https://github.com/ascribe/onion.git synced 2025-01-03 10:25:08 +01:00

invite user with token and signup without email validation

This commit is contained in:
diminator 2015-08-05 19:22:58 +02:00
parent 792325f71d
commit 18c7e2bc93

View File

@ -27,7 +27,7 @@ let SignupForm = React.createClass({
children: React.PropTypes.element children: React.PropTypes.element
}, },
mixins: [Router.Navigation], mixins: [Router.Navigation, Router.State],
getDefaultProps() { getDefaultProps() {
return { return {
@ -35,7 +35,6 @@ let SignupForm = React.createClass({
submitMessage: getLangText('Sign up') submitMessage: getLangText('Sign up')
}; };
}, },
getInitialState() { getInitialState() {
return UserStore.getState(); return UserStore.getState();
}, },
@ -57,22 +56,32 @@ let SignupForm = React.createClass({
} }
}, },
handleSuccess(response){ getFormData() {
let notification = new GlobalNotificationModel(getLangText('Sign up successful'), 'success', 50000); return this.getQuery();
GlobalNotificationActions.appendGlobalNotification(notification); },
this.props.handleSuccess(getLangText('We sent an email to your address') + ' ' + response.user.email + ', ' + getLangText('please confirm') + '.');
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() { render() {
let tooltipPassword = getLangText('Your password must be at least 10 characters') + '.\n ' + 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('This password is securing your digital property like a bank account') + '.\n ' +
getLangText('Store it in a safe place') + '!'; getLangText('Store it in a safe place') + '!';
return ( return (
<Form <Form
className="ascribe-form-bordered" className="ascribe-form-bordered"
ref='form' ref='form'
url={apiUrls.users_signup} url={apiUrls.users_signup}
getFormData={this.getFormData}
handleSuccess={this.handleSuccess} handleSuccess={this.handleSuccess}
buttons={ buttons={
<button type="submit" className="btn ascribe-btn ascribe-btn-login"> <button type="submit" className="btn ascribe-btn ascribe-btn-login">