mirror of
https://github.com/wassname/talk.git
synced 2026-08-13 12:40:11 +08:00
false positive on user signed in
This commit is contained in:
@@ -123,6 +123,12 @@ const checkLoginFailure = error => ({type: actions.CHECK_LOGIN_FAILURE, error});
|
||||
export const checkLogin = () => dispatch => {
|
||||
dispatch(checkLoginRequest());
|
||||
coralApi('/auth')
|
||||
.then(user => dispatch(checkLoginSuccess(user)))
|
||||
.then(user => {
|
||||
if (!user) {
|
||||
throw new Error('not logged in');
|
||||
}
|
||||
|
||||
dispatch(checkLoginSuccess(user));
|
||||
})
|
||||
.catch(error => dispatch(checkLoginFailure(error)));
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user