1
0
mirror of https://github.com/bitwarden/directory-connector synced 2025-12-21 02:33:14 +00:00

Refresh token with api key (#135)

* Do not persist client creds on logout

* Override refreshing token flow with re-authentication flow

* Update jslib

* PR review comments
This commit is contained in:
Matt Gibson
2021-06-22 16:13:08 -04:00
committed by GitHub
parent 4e098462dc
commit 647b087fa7
8 changed files with 71 additions and 7 deletions

View File

@@ -0,0 +1,16 @@
import { PlatformUtilsService } from 'jslib-common/abstractions/platformUtils.service';
import { TokenService } from 'jslib-common/abstractions/token.service';
import { NodeApiService as NodeApiServiceBase } from 'jslib-node/services/nodeApi.service';
export class NodeApiService extends NodeApiServiceBase {
constructor(tokenService: TokenService, platformUtilsService: PlatformUtilsService,
private refreshTokenCallback: () => Promise<void>, logoutCallback: (expired: boolean) => Promise<void>,
customUserAgent: string = null) {
super(tokenService, platformUtilsService, logoutCallback, customUserAgent);
}
doRefreshToken(): Promise<void> {
return this.refreshTokenCallback();
}
}