Return 401 on null keys (#4616)

This commit is contained in:
Joe Au-Yeung
2022-09-20 09:21:59 +01:00
committed by GitHub
parent f855f24d5c
commit 7e65d5d61d
@@ -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({