mirror of
https://github.com/Steffo99/festa.git
synced 2024-12-23 07:04: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"
|
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> {
|
export async function authorizeUser(req: NextApiRequest): Promise<User> {
|
||||||
const authorization = req.headers.authorization
|
const authorization = req.headers.authorization
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue