Files
sign/packages/auth/server/routes/session.ts

11 lines
338 B
TypeScript
Raw Normal View History

2025-01-02 15:33:37 +11:00
import { Hono } from 'hono';
import type { SessionValidationResult } from '../lib/session/session';
2025-02-16 00:44:01 +11:00
import { getOptionalSession } from '../lib/utils/get-session';
2025-01-02 15:33:37 +11:00
export const sessionRoute = new Hono().get('/session', async (c) => {
2025-02-16 00:44:01 +11:00
const session: SessionValidationResult = await getOptionalSession(c);
2025-01-02 15:33:37 +11:00
return c.json(session);
});