Return 401 on null keys (#4616)

This commit is contained in:
Joe Au-Yeung 2022-09-20 04:21:59 -04:00 committed by GitHub
parent f855f24d5c
commit 7e65d5d61d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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({