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:
parent
b24d4608dd
commit
a85447e94c
@ -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
|
||||
|
@ -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">
|
||||
|
@ -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}
|
||||
|
Loading…
Reference in New Issue
Block a user