Add middleware for role check

This commit is contained in:
Methapon2001 2024-03-11 09:28:59 +07:00
parent 610777e48d
commit 6ba483f0b7
2 changed files with 25 additions and 0 deletions

12
src/middlewares/user.ts Normal file
View file

@ -0,0 +1,12 @@
import type { Request } from "express";
export type RequestWithUser = Request & {
user: {
name: string;
given_name: string;
familiy_name: string;
preferred_username: string;
email: string;
role: string[];
};
};