added region to login

This commit is contained in:
yousef-alkhrissat
2024-08-09 19:27:51 +03:00
parent 3a5c518d11
commit 458fa1f66e
4 changed files with 36 additions and 4 deletions

View File

@ -17,10 +17,21 @@ export class AuthService {
private readonly configService: ConfigService,
) {}
async validateUser(email: string, pass: string): Promise<any> {
async validateUser(
email: string,
pass: string,
regionUuid?: string,
): Promise<any> {
const user = await this.userRepository.findOne({
where: {
email,
region: regionUuid
? {
uuid: regionUuid,
}
: {
regionName: 'United Arab Emirates',
},
},
relations: ['roles.roleType'],
});