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

Refresh v2 #38

Closed
wants to merge 4 commits into from
Closed
Changes from 1 commit
Commits
File filter
Filter file types
Jump to
Jump to file
Failed to load files.

Always

Just for now

Next

try to refresh token if get fails

  • Loading branch information
fcjr committed Dec 16, 2020
commit ae1a79a0e6871bb54264403d55f2133e1ad98914
@@ -12,8 +12,12 @@ class AccessToken {
injectLoggedInStatus(!!AccessToken.TOKEN);
}

static get() {
return AccessToken.TOKEN;
static async get() {
if (AccessToken.TOKEN) {
return AccessToken.TOKEN
}
await AccessToken.refresh();
return AccessToken.TOKEN
}

static parse() {
@@ -201,7 +201,7 @@ class TokenPool {
return;
}

const accessToken = AccessToken.get();
const accessToken = await AccessToken.get();
if (!accessToken) {
return;
}
ProTip! Use n and p to navigate between commits in a pull request.