fix(snjs): simplify authenticator api for generating options (#2147)
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
import { Username, Uuid } from '@standardnotes/domain-core'
|
||||
import { Uuid } from '@standardnotes/domain-core'
|
||||
|
||||
export interface AuthenticatorClientInterface {
|
||||
list(): Promise<Array<{ id: string; name: string }>>
|
||||
delete(authenticatorId: Uuid): Promise<boolean>
|
||||
generateRegistrationOptions(userUuid: Uuid, username: Username): Promise<Record<string, unknown> | null>
|
||||
generateRegistrationOptions(): Promise<Record<string, unknown> | null>
|
||||
verifyRegistrationResponse(
|
||||
userUuid: Uuid,
|
||||
name: string,
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/* istanbul ignore file */
|
||||
|
||||
import { AuthenticatorApiServiceInterface } from '@standardnotes/api'
|
||||
import { Username, Uuid } from '@standardnotes/domain-core'
|
||||
import { Uuid } from '@standardnotes/domain-core'
|
||||
|
||||
import { InternalEventBusInterface } from '../Internal/InternalEventBusInterface'
|
||||
import { AbstractService } from '../Service/AbstractService'
|
||||
@@ -43,9 +43,9 @@ export class AuthenticatorManager extends AbstractService implements Authenticat
|
||||
}
|
||||
}
|
||||
|
||||
async generateRegistrationOptions(userUuid: Uuid, username: Username): Promise<Record<string, unknown> | null> {
|
||||
async generateRegistrationOptions(): Promise<Record<string, unknown> | null> {
|
||||
try {
|
||||
const result = await this.authenticatorApiService.generateRegistrationOptions(userUuid.value, username.value)
|
||||
const result = await this.authenticatorApiService.generateRegistrationOptions()
|
||||
|
||||
if (result.data.error) {
|
||||
return null
|
||||
|
||||
Reference in New Issue
Block a user