(params: Pick<LoginParams, "appState">)
| 388 | } |
| 389 | |
| 390 | async addAuthenticatorFactor(params: Pick<LoginParams, "appState">): Promise<boolean> { |
| 391 | if (!this.sessionId) throw LoginError.userNotLoggedIn(); |
| 392 | await this.refreshSession(); |
| 393 | |
| 394 | const dataObject: AuthRequestPayload = { |
| 395 | actionType: AUTH_ACTIONS.ADD_AUTHENTICATOR_FACTOR, |
| 396 | options: { ...this.options, sdkMode: SDK_MODE.DEFAULT }, |
| 397 | params: { |
| 398 | ...params, |
| 399 | authConnection: AUTH_CONNECTION.AUTHENTICATOR, |
| 400 | }, |
| 401 | sessionId: this.sessionId, |
| 402 | accessToken: await this.getAccessToken(), |
| 403 | }; |
| 404 | |
| 405 | const result = await this.authHandler(`${this.baseUrl}/start`, dataObject); |
| 406 | if (!result) return false; |
| 407 | if (isAuthFlowError(result)) return false; |
| 408 | return true; |
| 409 | } |
| 410 | |
| 411 | async addPasskeyFactor(params: Pick<LoginParams, "appState">): Promise<boolean> { |
| 412 | if (!this.sessionId) throw LoginError.userNotLoggedIn(); |
nothing calls this directly
no test coverage detected