(loginId: Hex, payload: AuthRequestPayload, timeout = 600, skipAwait = false)
| 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 { |
no test coverage detected