2 Commits

Author SHA1 Message Date
adfbd5f8a3 adding optional auth to guard 2024-09-24 08:48:10 -05:00
72683c9ae2 adding optional auth to guard 2024-09-24 08:47:52 -05:00
2 changed files with 5 additions and 2 deletions

View File

@@ -15,8 +15,11 @@ export class AuthGuard extends PassportAuthGuard('azure-ad') implements CanActiv
'isPublic',
context.getHandler()
);
const req = context.switchToHttp().getRequest();
const authHeader = req.headers.authorization;
const token = authHeader && authHeader.split(' ')[1];
if (isPublic) {
if (isPublic && !token) {
return true;
}

View File

@@ -1,6 +1,6 @@
{
"name": "@noahspan/noahspan-modules",
"version": "0.3.9",
"version": "0.4.0",
"description": "",
"author": "",
"license": "UNLICENSED",