expria-backend/src/routes/auth.ts

21 lines
517 B
TypeScript

import { Hono } from 'hono'
import { authMiddleware } from '../middleware/auth'
import type { AppVariables } from '../middleware/auth'
const auth = new Hono<{ Variables: AppVariables }>()
auth.post('/verify-token', authMiddleware, (c) => {
const profile = c.get('profile')
return c.json(
{
id: profile.id,
email: profile.email,
plan: profile.plan,
simulations_used: profile.simulations_used,
plan_expires_at: profile.plan_expires_at,
},
200
)
})
export default auth