WIP changes

This commit is contained in:
daniel31x13
2023-11-02 01:52:49 -04:00
parent b1b0d98eb2
commit b458fad567
20 changed files with 358 additions and 43 deletions
+9 -17
View File
@@ -1,18 +1,10 @@
// For future...
// import { getToken } from "next-auth/jwt";
import { NextApiRequest, NextApiResponse } from "next";
import { getToken } from "next-auth/jwt";
// export default async (req, res) => {
// // If you don't have NEXTAUTH_SECRET set, you will have to pass your secret as `secret` to `getToken`
// console.log({ req });
// const token = await getToken({ req, raw: true });
// if (token) {
// // Signed in
// console.log("JSON Web Token", JSON.stringify(token, null, 2));
// } else {
// // Not Signed in
// res.status(401);
// }
// res.end();
// };
export {};
export default async (req: NextApiRequest, res: NextApiResponse) => {
// if using `NEXTAUTH_SECRET` env variable, we detect it, and you won't actually need to `secret`
// const token = await getToken({ req })
const token = await getToken({ req });
console.log("JSON Web Token", token);
res.end();
};