1
0
mirror of https://github.com/ascribe/onion.git synced 2024-06-30 13:41:57 +02: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 onLogin: React.PropTypes.func
}, },
mixins: [Router.Navigation], mixins: [Router.Navigation, Router.State],
getDefaultProps() { getDefaultProps() {
return { return {
@ -95,6 +95,7 @@ let LoginForm = React.createClass({
}, },
render() { render() {
let email = this.getQuery().email ? this.getQuery().email : null;
return ( return (
<Form <Form
className="ascribe-form-bordered" className="ascribe-form-bordered"
@ -122,7 +123,8 @@ let LoginForm = React.createClass({
<input <input
type="email" type="email"
placeholder={getLangText('Enter your email')} placeholder={getLangText('Enter your email')}
name="username" name="email"
defaultValue={email}
required/> required/>
</Property> </Property>
<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() { 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 ' +
@ -76,7 +84,7 @@ let SignupForm = React.createClass({
className="ascribe-form-bordered" className="ascribe-form-bordered"
ref='form' ref='form'
url={ApiUrls.users_signup} url={ApiUrls.users_signup}
getFormData={this.getQuery} 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">

View File

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