We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Originally posted by izumovn November 12, 2022 Error handling when telegram unavailable error and application crash when module is initialized?
Example app crashed
The text was updated successfully, but these errors were encountered:
import { ExecutionContext, Injectable, Type } from '@nestjs/common'; import { Reflector } from '@nestjs/core'; import { AuthGuard } from '@nestjs/passport'; import { Observable } from 'rxjs';
import { IS_PUBLIC_KEY, JWT_GUARD, } from '@/application/api/http-rest/authentication/constants';
@Injectable() export class HttpJwtAuthGuard extends AuthGuard(JWT_GUARD) { public constructor(private readonly reflector: Reflector = new Reflector()) { super(); }
public canActivate( context: ExecutionContext, ): boolean | Promise | Observable { const contextType: string = context.getType();
if (contextType === 'telegraf') { return true; } const isPublic: boolean = this.reflector.getAllAndOverride<boolean>( IS_PUBLIC_KEY, [context.getHandler(), context.getClass()], ); if (isPublic) { return true; } return super.canActivate(context);
} }
Sorry, something went wrong.
HttpJwtAuthGuard
It has to work inside the application, and the function is called from another service
No branches or pull requests
Discussed in #987
Originally posted by izumovn November 12, 2022
Error handling when telegram unavailable error and application crash when module is initialized?
Example app crashed
The text was updated successfully, but these errors were encountered: