mirror of
https://dev.azure.com/tstanciu94/PhantomMind/_git/Bitip
synced 2025-10-13 01:52:19 +03:00
refactor: add early return for health check endpoint in API key authentication middleware
This commit is contained in:
parent
900f5ad238
commit
ae34658fba
@ -11,6 +11,11 @@ export const apiKeyAuth = (
|
|||||||
res: Response,
|
res: Response,
|
||||||
next: NextFunction
|
next: NextFunction
|
||||||
): void => {
|
): void => {
|
||||||
|
if (req.path === '/health') {
|
||||||
|
next();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
const apiKey = req.header('X-API-Key') || (req.query.apikey as string);
|
const apiKey = req.header('X-API-Key') || (req.query.apikey as string);
|
||||||
|
|
||||||
if (!apiKey) {
|
if (!apiKey) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user