File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed
Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -2,10 +2,14 @@ import express from 'express';
22import { Request , Response , NextFunction } from "express" ;
33import { CustomSessionData } from "./session" ;
44import { IntraUser } from '../intra/oauth' ;
5- import { hasPiscineHistoryAccess } from '../utils' ;
5+ import { checkDirectAuthSecret , hasPiscineHistoryAccess } from '../utils' ;
66
77
88const checkIfAuthenticated = function ( req : Request , res : Response , next : NextFunction ) {
9+ if ( req . path . endsWith ( '/keyauth' ) && checkDirectAuthSecret ( req ) ) {
10+ // Authorization Bearer header is valid, do not require authentication using OAuth2
11+ return next ( ) ;
12+ }
913 if ( req . path . startsWith ( '/login' ) || req . path . startsWith ( '/logout' ) || res . statusCode === 503 ) {
1014 return next ( ) ;
1115 }
You can’t perform that action at this time.
0 commit comments