(params: Pick<LoginParams, "appState">)
| 409 | } |
| 410 | |
| 411 | async addPasskeyFactor(params: Pick<LoginParams, "appState">): Promise<boolean> { |
| 412 | if (!this.sessionId) throw LoginError.userNotLoggedIn(); |
| 413 | await this.refreshSession(); |
| 414 | |
| 415 | const dataObject: AuthRequestPayload = { |
| 416 | actionType: AUTH_ACTIONS.ADD_PASSKEY_FACTOR, |
| 417 | options: { ...this.options, sdkMode: SDK_MODE.DEFAULT }, |
| 418 | params: { |
| 419 | ...params, |
| 420 | authConnection: AUTH_CONNECTION.PASSKEYS, |
| 421 | }, |
| 422 | sessionId: this.sessionId, |
| 423 | accessToken: await this.getAccessToken(), |
| 424 | }; |
| 425 | |
| 426 | const result = await this.authHandler(`${this.baseUrl}/start`, dataObject); |
| 427 | if (!result) return false; |
| 428 | if (isAuthFlowError(result)) return false; |
| 429 | return true; |
| 430 | } |
| 431 | |
| 432 | async cleanup() { |
| 433 | if (this.authProvider) this.authProvider.cleanup(); |
nothing calls this directly
no test coverage detected