diff options
author | Anike Arni <aarni@thoughtworks.com> | 2017-03-30 17:23:41 -0300 |
---|---|---|
committer | Anike Arni <aarni@thoughtworks.com> | 2017-03-31 18:29:48 -0300 |
commit | 7be03150100d319c6d373241f614a29b374cb74d (patch) | |
tree | 90a553dfa0b6f119300a00e6ef02788923035e5c /web-ui/src/account_recovery/page.js | |
parent | f40808a147d1135e8bbee6d78306a598cf5ca647 (diff) |
[#935] Submits user recovery code to new endpoint
with @deniscostadsc
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; |