mirror of
https://github.com/docmost/docmost.git
synced 2026-05-16 14:14:06 +08:00
803f1f0b81
* user session management * WIP * cleanup * license * cleanup * don't cache index * rename current device property * fix
18 lines
498 B
TypeScript
18 lines
498 B
TypeScript
import api from "@/lib/api-client";
|
|
import { ISession } from "@/features/session/types/session.types";
|
|
|
|
export async function getSessions(): Promise<ISession[]> {
|
|
const req = await api.post<{ sessions: ISession[] }>("/sessions");
|
|
return req.data.sessions;
|
|
}
|
|
|
|
export async function revokeSession(data: {
|
|
sessionId: string;
|
|
}): Promise<void> {
|
|
await api.post("/sessions/revoke", data);
|
|
}
|
|
|
|
export async function revokeAllSessions(): Promise<void> {
|
|
await api.post("/sessions/revoke-all");
|
|
}
|