mirror of
https://github.com/kremalicious/umami.git
synced 2024-12-01 00:08:11 +01:00
14 lines
350 B
TypeScript
14 lines
350 B
TypeScript
import { NextApiResponse } from 'next';
|
|
import { useAuth } from 'lib/middleware';
|
|
import { NextApiRequestQueryBody, User } from 'lib/types';
|
|
import { ok } from 'next-basics';
|
|
|
|
export default async (
|
|
req: NextApiRequestQueryBody<unknown, unknown>,
|
|
res: NextApiResponse<User>,
|
|
) => {
|
|
await useAuth(req, res);
|
|
|
|
return ok(res, req.auth.user);
|
|
};
|