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

Method revokeOtherSessions

src/node/services/serverAuthService.ts:560–582  ·  view source on GitHub ↗
(currentSessionId: string | null)

Source from the content-addressed store, hash-verified

558 }
559
560 async revokeOtherSessions(currentSessionId: string | null): Promise<number> {
561 if (!currentSessionId) {
562 return 0;
563 }
564
565 await using _lock = await this.sessionsMutex.acquire();
566 const data = await this.loadPersistedSessionsLocked();
567
568 const currentSessionExists = data.sessions.some((session) => session.id === currentSessionId);
569 if (!currentSessionExists) {
570 return 0;
571 }
572
573 const previousLength = data.sessions.length;
574 data.sessions = data.sessions.filter((session) => session.id === currentSessionId);
575 const removedCount = previousLength - data.sessions.length;
576
577 if (removedCount > 0) {
578 await this.savePersistedSessionsLocked(data);
579 }
580
581 return removedCount;
582 }
583
584 dispose(): void {
585 for (const flow of this.githubDeviceFlows.values()) {

Callers 3

ServerAccessSectionFunction · 0.80
routerFunction · 0.80

Calls 3

acquireMethod · 0.45

Tested by

no test coverage detected