Fix login password retrieval
This commit is contained in:
@@ -102,6 +102,7 @@ export class AuthService {
|
|||||||
async login(dto: LoginDto) {
|
async login(dto: LoginDto) {
|
||||||
const user = await this.dataSource.getRepository(User).findOne({
|
const user = await this.dataSource.getRepository(User).findOne({
|
||||||
where: { email: dto.email, is_active: true },
|
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))) {
|
if (!user || !(await this.comparePassword(dto.password, user.password_hash))) {
|
||||||
|
|||||||
Reference in New Issue
Block a user