We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6188752 commit b47b884Copy full SHA for b47b884
src/components/Session/withAuthentication.js
@@ -9,16 +9,18 @@ const withAuthentication = Component => {
9
super(props);
10
11
this.state = {
12
- authUser: null,
+ authUser: JSON.parse(localStorage.getItem('authUser')),
13
};
14
}
15
16
componentDidMount() {
17
this.listener = this.props.firebase.onAuthUserListener(
18
authUser => {
19
+ localStorage.setItem('authUser', JSON.stringify(authUser));
20
this.setState({ authUser });
21
},
22
() => {
23
+ localStorage.removeItem('authUser');
24
this.setState({ authUser: null });
25
26
);
0 commit comments