Return 401 on null keys (#4616)
This commit is contained in:
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({
|
||||
|
|
Loading…
Reference in New Issue
Block a user