mirror of
https://github.com/detleph/server.git
synced 2026-09-08 07:56:18 +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 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;
|
const { authorization } = req.headers;
|
||||||
|
|
||||||
if (!authorization) {
|
if (!authorization) {
|
||||||
|
|||||||
Reference in New Issue
Block a user