Skip to content

Commit dd1fba7

Browse files
committed
Merge pull request #22 from dopeboy/gh-pages
Make the dispatch before transitioning to an authenticated component
2 parents bee7c7d + 644556c commit dd1fba7

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/actions/LoginActions.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,18 @@ import RouterContainer from '../services/RouterContainer'
55
export default {
66
loginUser: (jwt) => {
77
var savedJwt = localStorage.getItem('jwt');
8-
8+
9+
AppDispatcher.dispatch({
10+
actionType: LOGIN_USER,
11+
jwt: jwt
12+
});
13+
914
if (savedJwt !== jwt) {
1015
var nextPath = RouterContainer.get().getCurrentQuery().nextPath || '/';
1116

1217
RouterContainer.get().transitionTo(nextPath);
1318
localStorage.setItem('jwt', jwt);
1419
}
15-
16-
AppDispatcher.dispatch({
17-
actionType: LOGIN_USER,
18-
jwt: jwt
19-
});
2020
},
2121
logoutUser: () => {
2222
RouterContainer.get().transitionTo('/login');

0 commit comments

Comments
 (0)