File tree Expand file tree Collapse file tree 1 file changed +10
-6
lines changed Expand file tree Collapse file tree 1 file changed +10
-6
lines changed Original file line number Diff line number Diff line change @@ -470,14 +470,18 @@ export class LocalPasswordVerifyProvider
470470 constructor (
471471 @repository (UserRepository )
472472 public userRepository : UserRepository ,
473- ) {}
473+ ) { }
474474
475475 value(): VerifyFunction .LocalPasswordFn {
476- return async (username , password ) => {
477- const user: User = new User (
478- await this .userRepository .verifyPassword (username , password ),
479- );
480- return user ;
476+ return async (username : any , password : any ) => {
477+ try {
478+ const user: AuthUser = new AuthUser (
479+ await this .userRepository .verifyPassword (username , password ),
480+ );
481+ return user ;
482+ } catch (error ) {
483+ throw new HttpErrors .Unauthorized (AuthErrorKeys .InvalidCredentials ).message ;
484+ }
481485 };
482486 }
483487}
You can’t perform that action at this time.
0 commit comments