1
Fork 0
mirror of https://github.com/Steffo99/festa.git synced 2024-12-22 14:44:21 +00:00

Document authorizeUser

This commit is contained in:
Steffo 2022-05-31 16:41:58 +02:00
parent f752eb2ad0
commit 06ef64627f
Signed by: steffo
GPG key ID: 6965406171929D01

View file

@ -4,6 +4,14 @@ import { client } from "./prismaClient"
import { Interrupt } from "./interrupt"
/**
* Find the user who is authenticating in a request.
*
* _For API route usage._
*
* @param req The request performed by the user.
* @returns The user.
*/
export async function authorizeUser(req: NextApiRequest): Promise<User> {
const authorization = req.headers.authorization