chore: auth verification (#2867) [skip e2e]
This commit is contained in:
@@ -166,7 +166,9 @@ describe('SignInWithRecoveryCodes', () => {
|
||||
})
|
||||
|
||||
it('should fail if the sign in with recovery code fails', async () => {
|
||||
authManager.signInWithRecoveryCodes = jest.fn().mockReturnValue(false)
|
||||
authManager.signInWithRecoveryCodes = jest.fn().mockReturnValue({
|
||||
success: false,
|
||||
})
|
||||
|
||||
const useCase = createUseCase()
|
||||
const result = await useCase.execute({
|
||||
|
||||
@@ -68,9 +68,18 @@ export class SignInWithRecoveryCodes implements UseCaseInterface<void> {
|
||||
recoveryCodes: dto.recoveryCodes,
|
||||
username: dto.username,
|
||||
password: rootKey.serverPassword as string,
|
||||
hvmToken: dto.hvmToken,
|
||||
})
|
||||
|
||||
if (signInResult === false) {
|
||||
if (signInResult.success === false) {
|
||||
if (signInResult.captchaURL) {
|
||||
return Result.fail(
|
||||
JSON.stringify({
|
||||
captchaURL: signInResult.captchaURL,
|
||||
}),
|
||||
)
|
||||
}
|
||||
|
||||
return Result.fail('Could not sign in with recovery code')
|
||||
}
|
||||
|
||||
|
||||
@@ -2,4 +2,5 @@ export interface SignInWithRecoveryCodesDTO {
|
||||
recoveryCodes: string
|
||||
username: string
|
||||
password: string
|
||||
hvmToken?: string
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user