* add first concept * remove setup status * split config page in multiple components * add custom branding docs * add test email button * fix invalid email from header * add migration * mount images to host * update docs * remove unused endpoint * run formatter
18 lines
525 B
TypeScript
18 lines
525 B
TypeScript
import { ExecutionContext, Injectable } from "@nestjs/common";
|
|
import { AuthGuard } from "@nestjs/passport";
|
|
import { ConfigService } from "src/config/config.service";
|
|
|
|
@Injectable()
|
|
export class JwtGuard extends AuthGuard("jwt") {
|
|
constructor(private config: ConfigService) {
|
|
super();
|
|
}
|
|
async canActivate(context: ExecutionContext): Promise<boolean> {
|
|
try {
|
|
return (await super.canActivate(context)) as boolean;
|
|
} catch {
|
|
return this.config.get("share.allowUnauthenticatedShares");
|
|
}
|
|
}
|
|
}
|