(sessionId: string)
| 538 | } |
| 539 | |
| 540 | async revokeSession(sessionId: string): Promise<boolean> { |
| 541 | const normalizedSessionId = normalizeOptionalString(sessionId); |
| 542 | if (!normalizedSessionId) { |
| 543 | return false; |
| 544 | } |
| 545 | |
| 546 | await using _lock = await this.sessionsMutex.acquire(); |
| 547 | const data = await this.loadPersistedSessionsLocked(); |
| 548 | |
| 549 | const previousLength = data.sessions.length; |
| 550 | data.sessions = data.sessions.filter((session) => session.id !== normalizedSessionId); |
| 551 | |
| 552 | if (data.sessions.length === previousLength) { |
| 553 | return false; |
| 554 | } |
| 555 | |
| 556 | await this.savePersistedSessionsLocked(data); |
| 557 | return true; |
| 558 | } |
| 559 | |
| 560 | async revokeOtherSessions(currentSessionId: string | null): Promise<number> { |
| 561 | if (!currentSessionId) { |
no test coverage detected