diff options
Diffstat (limited to 'src/containers/auth/LockedScreen.js')
-rw-r--r-- | src/containers/auth/LockedScreen.js | 30 |
1 files changed, 16 insertions, 14 deletions
diff --git a/src/containers/auth/LockedScreen.js b/src/containers/auth/LockedScreen.js index aced64a98..a04107072 100644 --- a/src/containers/auth/LockedScreen.js +++ b/src/containers/auth/LockedScreen.js | |||
@@ -4,13 +4,9 @@ import { inject, observer } from 'mobx-react'; | |||
4 | import Locked from '../../components/auth/Locked'; | 4 | import Locked from '../../components/auth/Locked'; |
5 | import SettingsStore from '../../stores/SettingsStore'; | 5 | import SettingsStore from '../../stores/SettingsStore'; |
6 | 6 | ||
7 | import { globalError as globalErrorPropType } from '../../prop-types'; | 7 | import { hash } from '../../helpers/password-helpers'; |
8 | 8 | ||
9 | export default @inject('stores', 'actions') @observer class LockedScreen extends Component { | 9 | export default @inject('stores', 'actions') @observer class LockedScreen extends Component { |
10 | static propTypes = { | ||
11 | error: globalErrorPropType.isRequired, | ||
12 | }; | ||
13 | |||
14 | state = { | 10 | state = { |
15 | error: false, | 11 | error: false, |
16 | } | 12 | } |
@@ -30,7 +26,7 @@ export default @inject('stores', 'actions') @observer class LockedScreen extends | |||
30 | correctPassword = ''; | 26 | correctPassword = ''; |
31 | } | 27 | } |
32 | 28 | ||
33 | if (String(password) === String(correctPassword)) { | 29 | if (hash(String(password)) === String(correctPassword)) { |
34 | this.props.actions.settings.update({ | 30 | this.props.actions.settings.update({ |
35 | type: 'app', | 31 | type: 'app', |
36 | data: { | 32 | data: { |
@@ -56,17 +52,23 @@ export default @inject('stores', 'actions') @observer class LockedScreen extends | |||
56 | } | 52 | } |
57 | 53 | ||
58 | render() { | 54 | render() { |
59 | const { stores, error } = this.props; | 55 | const { stores } = this.props; |
60 | const { useTouchIdToUnlock } = this.props.stores.settings.all.app; | 56 | const { useTouchIdToUnlock } = this.props.stores.settings.all.app; |
61 | 57 | ||
62 | return ( | 58 | return ( |
63 | <Locked | 59 | <div className="auth"> |
64 | onSubmit={this.onSubmit} | 60 | <div className="auth__layout"> |
65 | unlock={this.unlock} | 61 | <div className="auth__container"> |
66 | useTouchIdToUnlock={useTouchIdToUnlock} | 62 | <Locked |
67 | isSubmitting={stores.user.loginRequest.isExecuting} | 63 | onSubmit={this.onSubmit} |
68 | error={this.state.error || error} | 64 | unlock={this.unlock} |
69 | /> | 65 | useTouchIdToUnlock={useTouchIdToUnlock} |
66 | isSubmitting={stores.user.loginRequest.isExecuting} | ||
67 | error={this.state.error || {}} | ||
68 | /> | ||
69 | </div> | ||
70 | </div> | ||
71 | </div> | ||
70 | ); | 72 | ); |
71 | } | 73 | } |
72 | } | 74 | } |