renamed a type + small improvements

This commit is contained in:
Daniel
2023-06-16 16:25:21 +03:30
parent 93558bb791
commit c1831b650d
18 changed files with 70 additions and 70 deletions
-26
View File
@@ -1,26 +0,0 @@
import type { NextApiRequest, NextApiResponse } from "next";
import { getServerSession } from "next-auth/next";
import { authOptions } from "pages/api/auth/[...nextauth]";
type Data = {
message: string;
data?: object;
};
export default async function handler(
req: NextApiRequest,
res: NextApiResponse<Data>
) {
const session = await getServerSession(req, res, authOptions);
console.log(session);
if (!session) {
res.status(401).json({ message: "You must be logged in." });
return;
}
return res.json({
message: "Success",
});
}