This commit is contained in:
2020-11-20 18:12:52 +01:00
parent 840407cd8f
commit eb77794fa5
7 changed files with 64 additions and 12 deletions

View File

@@ -149,6 +149,9 @@ export const refreshUserData = (token) => {
);
})
.catch((err) => {
if (err.status === 401) {
dispatch(logout());
}
console.log(err);
});
};
@@ -237,7 +240,7 @@ export const changePassword = (email, password, token) => {
export const logout = () => {
return function (dispatch) {
dispatch(notification("Poprawnie wylogowano.", "success"));
dispatch(notification("Wylogowano.", "info"));
dispatch(toggles.setLoggedOut());
};
};