Return 401 on null keys (#4616)

This commit is contained in:
Joe Au-Yeung authored and GitHub committed 2022-09-20 09:21:59 +01:00
1 parent f855f24d5c
commit 7e65d5d61d
1 file changed
+2
@@ -38,6 +38,8 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse)
const token = await oAuth2Client.getToken(code);
key = token.res?.data;
if (!key) res.status(401).json({ message: "Permissions not granted" });
}
await prisma.credential.create({