fix(snjs): simplify authenticator api for generating options (#2147)

This commit is contained in:
Karol Sójko
2023-01-11 14:44:31 +01:00
committed by GitHub
parent 2e7302e3c1
commit 5d20a53e6e
12 changed files with 18 additions and 76 deletions

View File

@@ -58,10 +58,7 @@ export class AuthenticatorApiService implements AuthenticatorApiServiceInterface
}
}
async generateRegistrationOptions(
userUuid: string,
username: string,
): Promise<GenerateAuthenticatorRegistrationOptionsResponse> {
async generateRegistrationOptions(): Promise<GenerateAuthenticatorRegistrationOptionsResponse> {
if (this.operationsInProgress.get(AuthenticatorApiOperations.GenerateRegistrationOptions)) {
throw new ApiCallError(ErrorMessage.GenericInProgress)
}
@@ -69,10 +66,7 @@ export class AuthenticatorApiService implements AuthenticatorApiServiceInterface
this.operationsInProgress.set(AuthenticatorApiOperations.GenerateRegistrationOptions, true)
try {
const response = await this.authenticatorServer.generateRegistrationOptions({
username,
userUuid,
})
const response = await this.authenticatorServer.generateRegistrationOptions()
return response
} catch (error) {
@@ -116,7 +110,7 @@ export class AuthenticatorApiService implements AuthenticatorApiServiceInterface
this.operationsInProgress.set(AuthenticatorApiOperations.GenerateAuthenticationOptions, true)
try {
const response = await this.authenticatorServer.generateAuthenticationOptions({})
const response = await this.authenticatorServer.generateAuthenticationOptions()
return response
} catch (error) {

View File

@@ -10,10 +10,7 @@ import {
export interface AuthenticatorApiServiceInterface {
list(): Promise<ListAuthenticatorsResponse>
delete(authenticatorId: string): Promise<DeleteAuthenticatorResponse>
generateRegistrationOptions(
userUuid: string,
username: string,
): Promise<GenerateAuthenticatorRegistrationOptionsResponse>
generateRegistrationOptions(): Promise<GenerateAuthenticatorRegistrationOptionsResponse>
verifyRegistrationResponse(
userUuid: string,
name: string,