From 12259588980a075e5fb375cb18f9867ac82089d6 Mon Sep 17 00:00:00 2001 From: Hamza-Ayed Date: Fri, 17 Apr 2026 01:57:18 +0300 Subject: [PATCH] Fix login password retrieval --- backend/src/data-source.ts | 2 +- backend/src/modules/auth/auth.service.ts | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/backend/src/data-source.ts b/backend/src/data-source.ts index 1a90ffb..daed828 100644 --- a/backend/src/data-source.ts +++ b/backend/src/data-source.ts @@ -21,4 +21,4 @@ export const AppDataSource = new DataSource({ entities: [__dirname + '/**/*.entity{.ts,.js}'], migrations: [__dirname + '/migrations/*{.ts,.js}'], subscribers: [], -}); +}); \ No newline at end of file diff --git a/backend/src/modules/auth/auth.service.ts b/backend/src/modules/auth/auth.service.ts index 93154c2..a714934 100644 --- a/backend/src/modules/auth/auth.service.ts +++ b/backend/src/modules/auth/auth.service.ts @@ -102,6 +102,7 @@ export class AuthService { async login(dto: LoginDto) { const user = await this.dataSource.getRepository(User).findOne({ where: { email: dto.email, is_active: true }, + select: ['id', 'email', 'password_hash', 'tenant_id', 'role', 'name'], }); if (!user || !(await this.comparePassword(dto.password, user.password_hash))) {