mirror of
https://github.com/SyncrowIOT/backend.git
synced 2025-07-16 18:56:22 +00:00
added region to login
This commit is contained in:
@ -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'],
|
||||
});
|
||||
|
Reference in New Issue
Block a user