Skip to content

Commit 64ac971

Browse files
refactor: change return type of refreshAccessToken to boolean
1 parent f22a8f3 commit 64ac971

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

src/atlclients/authStore.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ import {
2626
UpdateAuthInfoEvent,
2727
} from './authInfo';
2828
import { OAuthRefesher } from './oauthRefresher';
29-
import { Tokens } from './tokens';
3029
const keychainServiceNameV3 = version.endsWith('-insider') ? 'atlascode-insiders-authinfoV3' : 'atlascode-authinfoV3';
3130

3231
enum Priority {
@@ -306,15 +305,14 @@ export class CredentialManager implements Disposable {
306305
/**
307306
* Calls the OAuth provider and updates the access token.
308307
*/
309-
public async refreshAccessToken(site: DetailedSiteInfo): Promise<Tokens | undefined> {
308+
public async refreshAccessToken(site: DetailedSiteInfo): Promise<boolean> {
310309
const credentials = await this.getAuthInfo(site);
311310
if (!isOAuthInfo(credentials)) {
312-
return undefined;
311+
return false;
313312
}
314313
Logger.debug(`refreshingAccessToken for ${site.baseApiUrl} credentialID: ${site.credentialId}`);
315314

316315
const provider: OAuthProvider | undefined = oauthProviderForSite(site);
317-
const newTokens = undefined;
318316
if (provider && credentials) {
319317
const tokenResponse = await this._refresher.getNewTokens(provider, credentials.refresh);
320318
if (tokenResponse.tokens) {
@@ -333,7 +331,7 @@ export class CredentialManager implements Disposable {
333331
this.saveAuthInfo(site, credentials);
334332
}
335333
}
336-
return newTokens;
334+
return true;
337335
}
338336

339337
/**

0 commit comments

Comments
 (0)