Skip to content

Commit 362be95

Browse files
author
Vito Chin
committed
Auth with State instead in Login page
1 parent a23f741 commit 362be95

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/LoginPage/LoginPage.jsx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,13 @@ class LoginPage extends React.Component {
2121
this.handleSubmit = this.handleSubmit.bind(this);
2222
}
2323

24+
componentWillMount() {
25+
let authState = localStorage.getItem('state');
26+
if (authState) {
27+
this.props.dispatch(userActions.loginWithState(authState));
28+
}
29+
}
30+
2431
handleChange(e) {
2532
const { name, value } = e.target;
2633
this.setState({ [name]: value });

0 commit comments

Comments
 (0)