1
0
mirror of https://github.com/stonith404/pingvin-share.git synced 2024-07-01 23:20:13 +02:00

refactor: run formatter

This commit is contained in:
Elias Schneider 2022-10-18 14:30:41 +02:00
parent 84d29dff68
commit 38986c971a
3 changed files with 4 additions and 3 deletions

View File

@ -9,6 +9,8 @@ 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 process.env.ALLOW_UNAUTHENTICATED_SHARES == "true"
? true
: super.canActivate(context);
}
}

View File

@ -11,7 +11,6 @@ export class JwtStrategy extends PassportStrategy(Strategy) {
super({
jwtFromRequest: ExtractJwt.fromAuthHeaderAsBearerToken(),
secretOrKey: config.get("JWT_SECRET"),
});
}

View File

@ -28,7 +28,7 @@ export class ShareOwnerGuard implements CanActivate {
if (!share) throw new NotFoundException("Share not found");
if(!share.creatorId) return true;
if (!share.creatorId) return true;
return share.creatorId == (request.user as User).id;
}