mirror of
https://github.com/ershisan99/flashcards-api.git
synced 2026-01-02 20:59:27 +00:00
add error handling for db calls
This commit is contained in:
@@ -14,7 +14,7 @@ export class LocalStrategy extends PassportStrategy(Strategy) {
|
||||
async validate(email: string, password: string): Promise<any> {
|
||||
const newCredentials = await this.authService.checkCredentials(email, password)
|
||||
if (newCredentials.resultCode === 1) {
|
||||
throw new UnauthorizedException()
|
||||
throw new UnauthorizedException('Invalid credentials')
|
||||
}
|
||||
return newCredentials
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user