mirror of
https://github.com/detleph/server.git
synced 2026-09-04 08:36:06 +02:00
Export requireAuthentication
This commit is contained in:
@@ -10,7 +10,7 @@ const verifyAuthorizationFormat = (authorization: string) => /^Bearer .+$/.test(
|
||||
|
||||
const getBearerToken = (authorization: string) => authorization.slice(7);
|
||||
|
||||
const requireAuthentication = async (req: Request, res: Response, next: NextFunction) => {
|
||||
export const requireAuthentication = async (req: Request, res: Response, next: NextFunction) => {
|
||||
const { authorization } = req.headers;
|
||||
|
||||
if (!authorization) {
|
||||
|
||||
Reference in New Issue
Block a user