mirror of
https://github.com/BradNut/umami
synced 2025-09-08 17:40:29 +00:00
12 lines
324 B
TypeScript
12 lines
324 B
TypeScript
import { NextApiRequestAuth } from 'lib/types';
|
|
import { useAuth } from 'lib/middleware';
|
|
import { NextApiResponse } from 'next';
|
|
import { ok } from 'next-basics';
|
|
|
|
export default async (req: NextApiRequestAuth, res: NextApiResponse) => {
|
|
await useAuth(req, res);
|
|
|
|
const { user } = req.auth;
|
|
|
|
return ok(res, user);
|
|
};
|