Added basic validation for requests
This commit is contained in:
@@ -13,6 +13,8 @@ export async function POST(req: Request) {
|
||||
|
||||
if (!token_type)
|
||||
return NextResponse.json({ error: null, message: 'No token type given for the authorization.', success: false }, { status: 400 })
|
||||
if (token_type !== "bearer")
|
||||
return NextResponse.json({ error: null, message: 'Invalid token type given for the authorization.', success: false }, { status: 400 })
|
||||
|
||||
if (!access_token)
|
||||
return NextResponse.json({ error: null, message: 'No access token given for the authorization.', success: false }, { status: 400 })
|
||||
|
||||
Reference in New Issue
Block a user