This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { NextApiRequest, NextApiResponse } from "next"; | |
import { fieldValue, firestore } from "../../firebase/adminApp"; | |
export default async function handler( | |
req: NextApiRequest, | |
res: NextApiResponse | |
) { | |
try { | |
const usersDocs = (await firestore.collection("users").get()).docs; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { firestore } from "@/firebase/adminApp"; | |
import { NextApiRequest, NextApiResponse } from "next"; | |
const handleAuthorization = (authorization: string | undefined) => { | |
const updateAPIKey = process.env.VENUS_UPDATE_KEY; | |
if (!updateAPIKey) return false; | |
if (!authorization) return false; | |
return updateAPIKey === authorization; |