Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

don't refresh on overwrite #25

Merged
merged 1 commit into from Nov 9, 2020
Merged
Changes from all commits
Commits
File filter
Filter file types
Jump to
Jump to file
Failed to load files.

Always

Just for now

@@ -39,7 +39,7 @@ function parseJwt(token) {
};

const cookieListener = (changeInfo) => {
const { cookie, removed } = changeInfo;
const { cookie, removed, cause } = changeInfo;
if (cookie.domain !== AUTH_DOMAIN) {
return;
}
@@ -50,9 +50,13 @@ const cookieListener = (changeInfo) => {

if (removed) {
AccessToken.destroy();
// try to refresh the token incase remove was caused by
// token expiring
AccessToken.refresh();

if (cause !== "overwrite") {
// try to refresh the token incase remove was caused by
// token expiring
AccessToken.refresh();
}

return;
}

ProTip! Use n and p to navigate between commits in a pull request.