MCPcopy Create free account
hub / github.com/Web3Auth/Auth / addPasskeyFactor

Method addPasskeyFactor

src/core/auth.ts:411–430  ·  view source on GitHub ↗
(params: Pick<LoginParams, "appState">)

Source from the content-addressed store, hash-verified

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();

Callers

nothing calls this directly

Calls 5

refreshSessionMethod · 0.95
getAccessTokenMethod · 0.95
authHandlerMethod · 0.95
isAuthFlowErrorFunction · 0.90
userNotLoggedInMethod · 0.80

Tested by

no test coverage detected