mirror of
https://github.com/bitwarden/browser
synced 2025-12-10 13:23:34 +00:00
Auth/PM-7092 - Fix CLI login via API key not working due to TokenService changes (#8499)
* PM-7092 - Fix CLI login via API key not working (it apparently receives an undefined refresh token which was rejected by setTokens) * PM-7092 - Fix base login strategy tests * PM-7092 - per discucssion with jake, refactor setTokens to accept optional refresh token instead of exposing setRefreshToken as public.
This commit is contained in:
@@ -186,9 +186,9 @@ describe("LoginStrategy", () => {
|
||||
|
||||
expect(tokenService.setTokens).toHaveBeenCalledWith(
|
||||
accessToken,
|
||||
refreshToken,
|
||||
mockVaultTimeoutAction,
|
||||
mockVaultTimeout,
|
||||
refreshToken,
|
||||
);
|
||||
|
||||
expect(stateService.addAccount).toHaveBeenCalledWith(
|
||||
|
||||
@@ -182,9 +182,9 @@ export abstract class LoginStrategy {
|
||||
// User id will be derived from the access token.
|
||||
await this.tokenService.setTokens(
|
||||
tokenResponse.accessToken,
|
||||
tokenResponse.refreshToken,
|
||||
vaultTimeoutAction as VaultTimeoutAction,
|
||||
vaultTimeout,
|
||||
tokenResponse.refreshToken, // Note: CLI login via API key sends undefined for refresh token.
|
||||
);
|
||||
|
||||
await this.stateService.addAccount(
|
||||
|
||||
Reference in New Issue
Block a user