import nextConnect from 'next-connect';
import { NextApiRequest, NextApiResponse, PageConfig } from 'next';
import '@mmstudio/an000042';
import an39 from '@mmstudio/an000039';
export type Result = {
ok: boolean;
};
const handler = nextConnect<NextApiRequest, NextApiResponse<Result>>();
handler.get(async (req, res) => {
const key = '01factory';
const token = req.cookies[key];
const user = await an39<IUserinfo>(token);
res.status(200).json({ ok: Boolean(user) });
});
export const config = {} as PageConfig;
export default handler;