error handling for login

This commit is contained in:
unknown
2024-08-11 15:39:58 +03:00
parent 2ce899089e
commit f27d84bd01

View File

@ -88,6 +88,7 @@ export class UserAuthService {
} }
async userLogin(data: UserLoginDto) { async userLogin(data: UserLoginDto) {
try {
const user = await this.authService.validateUser( const user = await this.authService.validateUser(
data.email, data.email,
data.password, data.password,
@ -121,6 +122,9 @@ export class UserAuthService {
}), }),
sessionId: session[1].uuid, sessionId: session[1].uuid,
}); });
} catch (error) {
throw new BadRequestException('Wrong email, password or region');
}
} }
async deleteUser(uuid: string) { async deleteUser(uuid: string) {