more updates to login-strategy tests
This commit is contained in:
parent
21dbc4c3bb
commit
a389358988
|
@ -121,7 +121,7 @@ describe("AuthRequestLoginStrategy", () => {
|
|||
const userKey = new SymmetricCryptoKey(new Uint8Array(64).buffer as CsprngArray) as UserKey;
|
||||
|
||||
masterPasswordService.masterKeySubject.next(masterKey);
|
||||
masterPasswordService.decryptUserKeyWithMasterKey.mockResolvedValue(userKey);
|
||||
masterPasswordService.mock.decryptUserKeyWithMasterKey.mockResolvedValue(userKey);
|
||||
|
||||
await authRequestLoginStrategy.logIn(credentials);
|
||||
|
||||
|
|
|
@ -248,7 +248,7 @@ describe("LoginStrategy", () => {
|
|||
|
||||
apiService.postIdentityToken.mockResolvedValue(tokenResponse);
|
||||
masterPasswordService.masterKeySubject.next(masterKey);
|
||||
masterPasswordService.decryptUserKeyWithMasterKey.mockResolvedValue(userKey);
|
||||
masterPasswordService.mock.decryptUserKeyWithMasterKey.mockResolvedValue(userKey);
|
||||
|
||||
const result = await passwordLoginStrategy.logIn(credentials);
|
||||
|
||||
|
@ -267,7 +267,7 @@ describe("LoginStrategy", () => {
|
|||
|
||||
apiService.postIdentityToken.mockResolvedValue(tokenResponse);
|
||||
masterPasswordService.masterKeySubject.next(masterKey);
|
||||
masterPasswordService.decryptUserKeyWithMasterKey.mockResolvedValue(userKey);
|
||||
masterPasswordService.mock.decryptUserKeyWithMasterKey.mockResolvedValue(userKey);
|
||||
|
||||
await passwordLoginStrategy.logIn(credentials);
|
||||
|
||||
|
|
|
@ -435,7 +435,7 @@ describe("SsoLoginStrategy", () => {
|
|||
|
||||
apiService.postIdentityToken.mockResolvedValue(tokenResponse);
|
||||
masterPasswordService.masterKeySubject.next(masterKey);
|
||||
masterPasswordService.decryptUserKeyWithMasterKey.mockResolvedValue(userKey);
|
||||
masterPasswordService.mock.decryptUserKeyWithMasterKey.mockResolvedValue(userKey);
|
||||
|
||||
await ssoLoginStrategy.logIn(credentials);
|
||||
|
||||
|
@ -486,7 +486,7 @@ describe("SsoLoginStrategy", () => {
|
|||
|
||||
apiService.postIdentityToken.mockResolvedValue(tokenResponse);
|
||||
masterPasswordService.masterKeySubject.next(masterKey);
|
||||
masterPasswordService.decryptUserKeyWithMasterKey.mockResolvedValue(userKey);
|
||||
masterPasswordService.mock.decryptUserKeyWithMasterKey.mockResolvedValue(userKey);
|
||||
|
||||
await ssoLoginStrategy.logIn(credentials);
|
||||
|
||||
|
|
|
@ -184,7 +184,7 @@ describe("UserApiLoginStrategy", () => {
|
|||
|
||||
apiService.postIdentityToken.mockResolvedValue(tokenResponse);
|
||||
masterPasswordService.masterKeySubject.next(masterKey);
|
||||
masterPasswordService.decryptUserKeyWithMasterKey.mockResolvedValue(userKey);
|
||||
masterPasswordService.mock.decryptUserKeyWithMasterKey.mockResolvedValue(userKey);
|
||||
|
||||
await apiLogInStrategy.logIn(credentials);
|
||||
|
||||
|
|
|
@ -87,9 +87,9 @@ export abstract class InternalMasterPasswordServiceAbstraction extends MasterPas
|
|||
* @param userId The desired user
|
||||
* @returns The user key
|
||||
*/
|
||||
abstract decryptUserKeyWithMasterKey(
|
||||
abstract decryptUserKeyWithMasterKey: (
|
||||
masterKey: MasterKey,
|
||||
userKey?: EncString,
|
||||
userId?: string,
|
||||
): Promise<UserKey>;
|
||||
) => Promise<UserKey>;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue