()
| 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(); |
no test coverage detected