Skip to content
This repository was archived by the owner on Jun 19, 2025. It is now read-only.
This repository was archived by the owner on Jun 19, 2025. It is now read-only.

Sentry does not trigger in AuthGuards' strategy #485

@bendadaniel

Description

@bendadaniel

Hello,
my sentry implementation work fine except one situation.

I am using on controller's routes Auth guard with custom strategy @UseGuards(LocalAuthGuard)

LocalAuthGuard strategy is simple class (local.strategy.ts):

@Injectable()
export class LocalStrategy extends PassportStrategy(Strategy) {
    constructor(private authService: AuthService) {
        super();
    }
    async validate(username: string, password: string): Promise<User | false> 
    {        

        throw new Error("sentry test error");    //!!!!!!!!!!!!!!!!!!!!!!!!!!

        let user = await this.authService.validateUserByPassword(username, password);        
        if (!user) 
            return false;               
        return user;
    }
}

when I throw error in function validate(), setry will not catch it..

Do you know where could be problem or is it normal?

Thank you
Daniel

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions