mirror of
https://github.com/SyncrowIOT/backend.git
synced 2025-11-26 10:24:53 +00:00
error handling for login
This commit is contained in:
@ -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) {
|
||||||
|
|||||||
Reference in New Issue
Block a user