Skip to content
This repository has been archived by the owner on Jan 11, 2020. It is now read-only.

Commit

Permalink
Fix signing out after changing password
Browse files Browse the repository at this point in the history
  • Loading branch information
prinsss committed Aug 7, 2017
1 parent 52281dd commit b948f27
Showing 1 changed file with 8 additions and 12 deletions.
20 changes: 8 additions & 12 deletions resources/assets/src/js/user/profile.js
Expand Up @@ -61,13 +61,11 @@ function changePassword() {
return swal({
type: 'success',
text: msg
}).then(() => logout()).catch(err => {
docCookies.removeItem('token') && console.warn(err);
}).then(() => {
return logout();
}).then(({ errno }) => {
if (errno == 0) {
window.location = url('auth/login');
}
}).catch(showAjaxError);
window.location = url('auth/login');
});
} else {
return swal({ type: 'warning', text: msg });
}
Expand Down Expand Up @@ -111,13 +109,11 @@ function changeEmail() {
return swal({
type: 'success',
text: msg
}).then(() => logout()).catch(err => {
docCookies.removeItem('token') && console.warn(err);
}).then(() => {
return logout();
}).then(({ errno }) => {
if (errno == 0) {
window.location = url('auth/login');
}
}).catch(showAjaxError);
window.location = url('auth/login');
});
} else {
return swal({ type: 'warning', text: msg });
}
Expand Down

0 comments on commit b948f27

Please sign in to comment.