Added checks for CLOUD_MODE.

This commit is contained in:
Mike Cao 2023-02-27 20:03:04 -08:00
parent 5657a64c77
commit 3ac560dc0f
24 changed files with 175 additions and 60 deletions

13
pages/api/me/index.ts Normal file
View file

@ -0,0 +1,13 @@
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);
};