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

Method storeAuthPayload

src/core/auth.ts:469–485  ·  view source on GitHub ↗
(loginId: Hex, payload: AuthRequestPayload, timeout = 600, skipAwait = false)

Source from the content-addressed store, hash-verified

467 }
468
469 private async storeAuthPayload(loginId: Hex, payload: AuthRequestPayload, timeout = 600, skipAwait = false): Promise<void> {
470 if (!this.sessionManager) throw InitializationError.notInitialized();
471
472 const authRequestStorageManager = new StorageManager<AuthRequestPayload>({
473 sessionServerBaseUrl: payload.options.storageServerUrl,
474 sessionNamespace: payload.options.sessionNamespace,
475 sessionTime: timeout, // each login key must be used with 10 mins (might be used at the end of popup redirect)
476 sessionId: loginId,
477 allowedOrigin: this.options.sdkUrl,
478 });
479
480 const promise = authRequestStorageManager.createSession(klona(payload));
481
482 if (payload.options.uxMode === UX_MODE.REDIRECT && !skipAwait) {
483 await promise;
484 }
485 }
486
487 private async _authorizeSession(): Promise<AuthSessionData | null> {
488 try {

Callers 2

manageMFAMethod · 0.95
authHandlerMethod · 0.95

Calls 1

notInitializedMethod · 0.80

Tested by

no test coverage detected