1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-16 08:13:42 +00:00

node fetch api

This commit is contained in:
Kyle Spearrin
2018-05-14 23:56:27 -04:00
parent 5850a590ce
commit 17cf059970
4 changed files with 22 additions and 3 deletions

View File

@@ -439,12 +439,10 @@ export class ApiService implements ApiServiceAbstraction {
}
private async handleTokenState(): Promise<string> {
let accessToken: string;
let accessToken = await this.tokenService.getToken();
if (this.tokenService.tokenNeedsRefresh()) {
const tokenResponse = await this.doRefreshToken();
accessToken = tokenResponse.accessToken;
} else {
accessToken = await this.tokenService.getToken();
}
return 'Bearer ' + accessToken;