debug: add debug log when login
continuous-integration/drone/tag Build is passing Details

pull/2/head devel_4.3
shancheas 2024-06-06 17:33:45 +07:00
parent 26a073968f
commit 9ff1012813
1 changed files with 7 additions and 0 deletions

View File

@ -2,6 +2,7 @@ import {
HttpStatus, HttpStatus,
Inject, Inject,
Injectable, Injectable,
Logger,
UnauthorizedException, UnauthorizedException,
} from '@nestjs/common'; } from '@nestjs/common';
import { validatePassword } from 'src/core/helpers/password/bcrypt.helpers'; import { validatePassword } from 'src/core/helpers/password/bcrypt.helpers';
@ -30,6 +31,7 @@ export class LoginManager extends BaseCustomManager<UserEntity> {
async process(): Promise<void> { async process(): Promise<void> {
// get user active by username // get user active by username
Logger.debug('getOneByOptions', 'LoginManager');
this.userLogin = await this.dataService.getOneByOptions({ this.userLogin = await this.dataService.getOneByOptions({
where: { where: {
username: this.data.username, username: this.data.username,
@ -54,9 +56,13 @@ export class LoginManager extends BaseCustomManager<UserEntity> {
user_privilege_id: this.userLogin.user_privilege_id, user_privilege_id: this.userLogin.user_privilege_id,
}; };
Logger.debug('Sign Token', 'LoginManager');
this.token = this.session.createAccessToken(tokenData); this.token = this.session.createAccessToken(tokenData);
Logger.debug('refreshToken', 'LoginManager');
const refreshToken = this.session.createAccessToken(tokenData); const refreshToken = this.session.createAccessToken(tokenData);
Logger.debug('Update Refresh Token', 'LoginManager');
// Update refresh token // Update refresh token
await this.dataService.update( await this.dataService.update(
this.queryRunner, this.queryRunner,
@ -67,6 +73,7 @@ export class LoginManager extends BaseCustomManager<UserEntity> {
}, },
); );
Logger.debug('Process Login Done', 'LoginManager');
return; return;
} }