mirror of
https://github.com/Steffo99/festa.git
synced 2024-12-22 22:54:22 +00:00
Document authorizeUser
This commit is contained in:
parent
f752eb2ad0
commit
06ef64627f
1 changed files with 8 additions and 0 deletions
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in a new issue