🚀 Fix: Login case-sensitivity & Restore Super Admin AI metrics access

This commit is contained in:
Hamza-Ayed
2026-04-22 22:37:48 +03:00
parent f72c13f29a
commit 944c82730d
6 changed files with 20 additions and 8 deletions

View File

@@ -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'],
});