Closed PatrykKuniczak closed 1 year ago
@Injectable() export class LocalStrategy extends PassportStrategy(Strategy) { constructor(private authService: AuthService) { super(); } async validate(username: string, password: string) { username = username.replace(/\s/g, "").toLowerCase(); const user = await this.authService.validateUser({username, password}); if (!user) { throw new UnauthorizedException() } return user } }
That's code it's very similiar to this from your docs.
And what the point, after last update
"@nestjs/passport": "9.0.1"
I have an Error in the console, after i throw any error from this authService or manually from this validate func.
Nest wrong handle throwed exeptions, i can throw ep.
throw new BadGatewayException()
And i have still that error:
My app work fine, but i have a info in the console.
That's work well on 9.0.0 version, only on the latest update this error occure.
Don't necessary in that case, code from docs it's the same
No response
Don't console.error(undefined) from AuthGuard :)
9.0.1
0.6.0
9.3.5
19.6.0
I using Windows 11, and WebStorm 2022.3.2
Fixed in the latest versions of @nestjs/passport & @nestjs/core
@nestjs/passport
@nestjs/core
Is there an existing issue for this?
Current behavior
That's code it's very similiar to this from your docs.
And what the point, after last update
I have an Error in the console, after i throw any error from this authService or manually from this validate func.
Nest wrong handle throwed exeptions, i can throw ep.
And i have still that error:
My app work fine, but i have a info in the console.
That's work well on 9.0.0 version, only on the latest update this error occure.
Minimum reproduction code
Don't necessary in that case, code from docs it's the same
Steps to reproduce
No response
Expected behavior
Don't console.error(undefined) from AuthGuard :)
Package version
9.0.1
Passport version
0.6.0
NestJS version
9.3.5
Node.js version
19.6.0
In which operating systems have you tested?
Other
I using Windows 11, and WebStorm 2022.3.2