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

Method refreshSession

src/core/auth.ts:455–467  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

453 }
454
455 async refreshSession(): Promise<void> {
456 const data = await this._authorizeSession();
457 if (!data || Object.keys(data).length === 0) {
458 try {
459 await this.sessionManager.logout();
460 } catch {
461 // session may already be invalid on the server, ignore cleanup errors
462 }
463 this.clearState();
464 throw LoginError.userNotLoggedIn();
465 }
466 this.updateState(data);
467 }
468
469 private async storeAuthPayload(loginId: Hex, payload: AuthRequestPayload, timeout = 600, skipAwait = false): Promise<void> {
470 if (!this.sessionManager) throw InitializationError.notInitialized();

Callers 7

loginMethod · 0.95
enableMFAMethod · 0.95
manageMFAMethod · 0.95
manageSocialFactorMethod · 0.95
addPasskeyFactorMethod · 0.95

Calls 5

_authorizeSessionMethod · 0.95
clearStateMethod · 0.95
updateStateMethod · 0.95
logoutMethod · 0.80
userNotLoggedInMethod · 0.80

Tested by

no test coverage detected