mirror of
https://github.com/detleph/server.git
synced 2026-09-06 23:44:26 +02:00
Add teamleader authentication
This commit is contained in:
@@ -8,9 +8,9 @@ import prisma from "../../lib/prisma";
|
||||
|
||||
const JWT_SECRET = process.env.JWT_SECRET || "secret";
|
||||
|
||||
const verifyAuthorizationFormat = (authorization: string) => /^Bearer .+$/.test(authorization);
|
||||
export const verifyAuthorizationFormat = (authorization: string) => /^Bearer .+$/.test(authorization);
|
||||
|
||||
const getBearerToken = (authorization: string) => authorization.slice(7);
|
||||
export const getBearerToken = (authorization: string) => authorization.slice(7);
|
||||
|
||||
export const requireAuthentication = async (req: Request, res: Response, next: NextFunction) => {
|
||||
const { authorization } = req.headers;
|
||||
|
||||
Reference in New Issue
Block a user