Skip to content

Commit 474fc21

Browse files
author
Wenfeng Zhu
committed
fix: force interactive token refresh after permission revocation
1 parent f893e81 commit 474fc21

File tree

1 file changed

+0
-13
lines changed

1 file changed

+0
-13
lines changed

src/modules/authentication/AuthenticationWrapper.ts

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,6 @@ export class AuthenticationWrapper implements IAuthenticationWrapper {
136136
*/
137137
public async refreshToken(scopes: string[] = []): Promise<AuthenticationResult> {
138138
this.revokingScopes = true;
139-
this.clearAccessTokenCache();
140139

141140
try {
142141
const result = await this.loginWithInteraction(scopes.length > 0 ? scopes : defaultScopes);
@@ -318,18 +317,6 @@ export class AuthenticationWrapper implements IAuthenticationWrapper {
318317
localStorage.removeItem(HOME_ACCOUNT_KEY);
319318
}
320319

321-
/**
322-
* Clears access token cache to force fresh token acquisition on next request
323-
*/
324-
public clearAccessTokenCache(): void {
325-
const keyFilter = this.getHomeAccountId() || 'login';
326-
const accessTokenKeys = Object.keys(localStorage).filter((key) =>
327-
key.includes(keyFilter) && key.includes('accesstoken')
328-
);
329-
accessTokenKeys.forEach((item: string) => {
330-
localStorage.removeItem(item);
331-
});
332-
}
333320

334321
/**
335322
* This is an own implementation of the clearCache() function that is no longer available;

0 commit comments

Comments
 (0)