🚀 Fix: Login case-sensitivity & Restore Super Admin AI metrics access
This commit is contained in:
@@ -100,8 +100,9 @@ export class AuthService {
|
||||
* تسجيل دخول
|
||||
*/
|
||||
async login(dto: LoginDto) {
|
||||
const normalizedEmail = dto.email.trim().toLowerCase();
|
||||
const user = await this.dataSource.getRepository(User).findOne({
|
||||
where: { email: dto.email, is_active: true },
|
||||
where: { email: normalizedEmail, is_active: true },
|
||||
select: ['id', 'email', 'password_hash', 'tenant_id', 'role', 'name'],
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user