mirror of
https://github.com/SyncrowIOT/backend.git
synced 2025-11-26 19:34:53 +00:00
Merge pull request #74 from SyncrowIOT/SP-342-implement-region-end-point-in-the-login
added region to login
This commit is contained in:
@ -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'],
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user