0
Fork 0
mirror of https://github.com/stonith404/pingvin-share.git synced 2025-02-19 01:55:48 -05:00

fix: jwt guard when unauthenticated shares are allowed

This commit is contained in:
Elias Schneider 2022-10-24 09:25:45 +02:00
parent e4019612f8
commit c2b87aba5c

View file

@ -9,8 +9,9 @@ export class JwtGuard extends AuthGuard("jwt") {
canActivate(
context: ExecutionContext
): boolean | Promise<boolean> | Observable<boolean> {
return process.env.ALLOW_UNAUTHENTICATED_SHARES == "true"
? true
: super.canActivate(context);
return (
super.canActivate(context) ||
process.env.ALLOW_UNAUTHENTICATED_SHARES == "true"
);
}
}