MCPcopy Index your code
hub / github.com/coder/mux / revokeSession

Method revokeSession

src/node/services/serverAuthService.ts:540–558  ·  view source on GitHub ↗
(sessionId: string)

Source from the content-addressed store, hash-verified

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) {

Callers 4

pollGithubDeviceFlowMethod · 0.95
ServerAccessSectionFunction · 0.80
routerFunction · 0.80

Calls 4

normalizeOptionalStringFunction · 0.70
acquireMethod · 0.45

Tested by

no test coverage detected