mirror of
https://github.com/documenso/documenso.git
synced 2025-11-14 00:32:43 +10:00
feat: sign out of all sessions (#1797)
This commit is contained in:
@ -2,7 +2,7 @@ import { Hono } from 'hono';
|
||||
import superjson from 'superjson';
|
||||
|
||||
import type { SessionValidationResult } from '../lib/session/session';
|
||||
import { getOptionalSession } from '../lib/utils/get-session';
|
||||
import { getActiveSessions, getOptionalSession } from '../lib/utils/get-session';
|
||||
|
||||
export const sessionRoute = new Hono()
|
||||
.get('/session', async (c) => {
|
||||
@ -10,6 +10,11 @@ export const sessionRoute = new Hono()
|
||||
|
||||
return c.json(session);
|
||||
})
|
||||
.get('/sessions', async (c) => {
|
||||
const sessions = await getActiveSessions(c);
|
||||
|
||||
return c.json(superjson.serialize({ sessions }));
|
||||
})
|
||||
.get('/session-json', async (c) => {
|
||||
const session: SessionValidationResult = await getOptionalSession(c);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user