1
0
mirror of https://github.com/ascribe/onion.git synced 2024-12-23 01:39:36 +01:00

bug fix user token on signup/login

This commit is contained in:
diminator 2015-09-16 19:00:59 +02:00
parent b24d4608dd
commit a85447e94c
3 changed files with 14 additions and 4 deletions

View File

@ -27,7 +27,7 @@ let LoginForm = React.createClass({
onLogin: React.PropTypes.func
},
mixins: [Router.Navigation],
mixins: [Router.Navigation, Router.State],
getDefaultProps() {
return {
@ -95,6 +95,7 @@ let LoginForm = React.createClass({
},
render() {
let email = this.getQuery().email ? this.getQuery().email : null;
return (
<Form
className="ascribe-form-bordered"
@ -122,7 +123,8 @@ let LoginForm = React.createClass({
<input
type="email"
placeholder={getLangText('Enter your email')}
name="username"
name="email"
defaultValue={email}
required/>
</Property>
<Property

View File

@ -66,6 +66,14 @@ let SignupForm = React.createClass({
}
},
getFormData() {
console.log(this.getQuery());
if (this.getQuery().token){
return {token: this.getQuery().token};
}
return null;
},
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 ' +
@ -76,7 +84,7 @@ let SignupForm = React.createClass({
className="ascribe-form-bordered"
ref='form'
url={ApiUrls.users_signup}
getFormData={this.getQuery}
getFormData={this.getFormData}
handleSuccess={this.handleSuccess}
buttons={
<button type="submit" className="btn ascribe-btn ascribe-btn-login">

View File

@ -178,7 +178,7 @@ let IkonotvRegisterPiece = React.createClass({
<RegisterPieceForm
disabled={this.state.step > 0}
enableLocalHashing={false}
headerMessage={getLangText('Submit to Cyland Archive')}
headerMessage={getLangText('Submit to IkonoTV')}
submitMessage={getLangText('Submit')}
isFineUploaderActive={this.state.isFineUploaderActive}
handleSuccess={this.handleRegisterSuccess}