Merge pull request #74 from SyncrowIOT/SP-342-implement-region-end-point-in-the-login

added region to login
This commit is contained in:
yousef-khriasat-uba
2024-08-11 14:23:53 +03:00
committed by GitHub
4 changed files with 34 additions and 4 deletions

View File

@ -17,10 +17,19 @@ 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,
}
: undefined,
},
relations: ['roles.roleType'],
});