mirror of
https://github.com/standardnotes/server
synced 2026-10-16 18:13:09 -04:00
fix(auth): authentication options
This commit is contained in:
+3
-3
@@ -54,7 +54,7 @@ describe('GenerateAuthenticatorAuthenticationOptions', () => {
|
||||
})
|
||||
|
||||
expect(result.isFailed()).toBe(true)
|
||||
expect(result.getError()).toBe('Could not generate authenticator registration options: Username cannot be empty')
|
||||
expect(result.getError()).toBe('Could not generate authenticator authentication options: Username cannot be empty')
|
||||
})
|
||||
|
||||
it('should return error if user uuid is not valid', async () => {
|
||||
@@ -70,7 +70,7 @@ describe('GenerateAuthenticatorAuthenticationOptions', () => {
|
||||
|
||||
expect(result.isFailed()).toBe(true)
|
||||
expect(result.getError()).toBe(
|
||||
'Could not generate authenticator registration options: Given value is not a valid uuid: invalid',
|
||||
'Could not generate authenticator authentication options: Given value is not a valid uuid: invalid',
|
||||
)
|
||||
})
|
||||
|
||||
@@ -97,7 +97,7 @@ describe('GenerateAuthenticatorAuthenticationOptions', () => {
|
||||
})
|
||||
|
||||
expect(result.isFailed()).toBe(true)
|
||||
expect(result.getError()).toBe('Could not generate authenticator registration options: Oops')
|
||||
expect(result.getError()).toBe('Could not generate authenticator authentication options: Oops')
|
||||
|
||||
mock.mockRestore()
|
||||
})
|
||||
|
||||
+3
-3
@@ -19,7 +19,7 @@ export class GenerateAuthenticatorAuthenticationOptions implements UseCaseInterf
|
||||
async execute(dto: GenerateAuthenticatorAuthenticationOptionsDTO): Promise<Result<Record<string, unknown>>> {
|
||||
const usernameOrError = Username.create(dto.username)
|
||||
if (usernameOrError.isFailed()) {
|
||||
return Result.fail(`Could not generate authenticator registration options: ${usernameOrError.getError()}`)
|
||||
return Result.fail(`Could not generate authenticator authentication options: ${usernameOrError.getError()}`)
|
||||
}
|
||||
const username = usernameOrError.getValue()
|
||||
|
||||
@@ -46,7 +46,7 @@ export class GenerateAuthenticatorAuthenticationOptions implements UseCaseInterf
|
||||
|
||||
const userUuidOrError = Uuid.create(user.uuid)
|
||||
if (userUuidOrError.isFailed()) {
|
||||
return Result.fail(`Could not generate authenticator registration options: ${userUuidOrError.getError()}`)
|
||||
return Result.fail(`Could not generate authenticator authentication options: ${userUuidOrError.getError()}`)
|
||||
}
|
||||
const userUuid = userUuidOrError.getValue()
|
||||
|
||||
@@ -67,7 +67,7 @@ export class GenerateAuthenticatorAuthenticationOptions implements UseCaseInterf
|
||||
})
|
||||
if (authenticatorChallengeOrError.isFailed()) {
|
||||
return Result.fail(
|
||||
`Could not generate authenticator registration options: ${authenticatorChallengeOrError.getError()}`,
|
||||
`Could not generate authenticator authentication options: ${authenticatorChallengeOrError.getError()}`,
|
||||
)
|
||||
}
|
||||
const authenticatorChallenge = authenticatorChallengeOrError.getValue()
|
||||
|
||||
Reference in New Issue
Block a user