diff options
author | Tulio Casagrande <tuliocasagrande@gmail.com> | 2017-04-04 13:14:34 -0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-04-04 13:14:34 -0300 |
commit | f70c2827d41d1d805d6446670b861b7abf0761b1 (patch) | |
tree | df266fda0c593a27c568215716d48d9994fbd344 /web-ui/src/account_recovery/page.js | |
parent | af454c71da106644eee644c4286bbae4788b8e14 (diff) | |
parent | d7914b9b5640c3d85c6230a032180b2e64520bca (diff) |
Merge pull request #1042 from pixelated/login-recovery-code
[#935] Sends user recovery code and password to account recovery endpoint
Diffstat (limited to 'web-ui/src/account_recovery/page.js')
-rw-r--r-- | web-ui/src/account_recovery/page.js | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/web-ui/src/account_recovery/page.js b/web-ui/src/account_recovery/page.js index 579f17cc..2d33e2fb 100644 --- a/web-ui/src/account_recovery/page.js +++ b/web-ui/src/account_recovery/page.js @@ -32,7 +32,7 @@ export class Page extends React.Component { constructor(props) { super(props); - this.state = { step: 0 }; + this.state = { step: 0, userCode: '' }; } nextStep = (event) => { @@ -44,13 +44,19 @@ export class Page extends React.Component { this.setState({ step: this.state.step - 1 }); } - steps = { - 0: <AdminRecoveryCodeForm next={this.nextStep} />, - 1: <UserRecoveryCodeForm previous={this.previousStep} next={this.nextStep} />, - 2: <NewPasswordForm previous={this.previousStep} /> + saveUserCode = (event) => { + this.setState({ userCode: event.target.value }); } - mainContent = () => this.steps[this.state.step]; + steps = () => ({ + 0: <AdminRecoveryCodeForm next={this.nextStep} />, + 1: (<UserRecoveryCodeForm + previous={this.previousStep} next={this.nextStep} saveCode={this.saveUserCode} + />), + 2: <NewPasswordForm previous={this.previousStep} userCode={this.state.userCode} /> + }) + + mainContent = () => this.steps()[this.state.step]; render() { const t = this.props.t; |