having one solution for different components of app

This commit is contained in:
Arjun Patel
2022-01-27 20:17:00 -08:00
parent 0d23d1dfd7
commit 0f7e5a831b
256 changed files with 7997 additions and 0 deletions
+25
View File
@@ -0,0 +1,25 @@
import { NextApiRequest, NextApiResponse } from "next";
// import { adminApp } from "../../../services/firebaseAdminService";
import { getAuth } from "firebase/auth";
import firebaseAdminAll, { credential } from "firebase-admin";
// todo do this here instead of cloud functions or just leave as is
export default async function handler(
req: NextApiRequest,
res: NextApiResponse
) {
console.log(req.cookies);
console.log(req.body);
if (!req.cookies.auth) {
res.status(401).send({ reason: "not authorized" });
return;
}
// if (!verifiedToken) {
// res.status(401).send({ reason: "auth token not valid" });
// return;
// }
res.status(200).json({ name: "John Doe" });
}