From ee4cf8a43e34e2248031e12a596530320055c0ee Mon Sep 17 00:00:00 2001 From: Narul Hidayah Date: Fri, 2 Jan 2026 23:28:52 +0700 Subject: [PATCH] updtae --- src/controllers/auth.ts | 22 ---------------------- src/controllers/user.ts | 4 ---- 2 files changed, 26 deletions(-) diff --git a/src/controllers/auth.ts b/src/controllers/auth.ts index 9060bf4..6c73e7d 100644 --- a/src/controllers/auth.ts +++ b/src/controllers/auth.ts @@ -46,19 +46,11 @@ export class AuthController { const userRepository = OrmHelper.DB.getRepository(User) const userRefreshTokenRepository = OrmHelper.DB.getRepository(UserRefreshToken) -<<<<<<< HEAD - const user = await userRepository.findOne({ - relations: ["roles", "roles.application", "employee"], - select: ["id", "email", "name", "password", "username", "roles"], - where: { username: param.username }, - }) -======= const user = await userRepository.findOne({ relations: ["roles", "roles.application"], select: ["id", "email", "name", "password", "username", "roles"], where: { username: param.username }, }) ->>>>>>> f562ccf38baffaa1cb6caf8a196127fe2512c7e4 if (user != null && user.roles != null && user.roles.length > 0 && user.checkIfPasswordMatch(param.password)) { const { browser, device, os } = UAParser(req.get("User-Agent")) @@ -108,19 +100,6 @@ export class AuthController { var privateKey = fs.readFileSync("src/helpers/key/private.key") -<<<<<<< HEAD - var token = jwt.sign( - { - exp: Math.floor(Date.now() / 1000) + Number(config.get("auth.access_token_lifetime")), - data: { - id: user.id, - username: user.username, - name: user.name, - id_role: role_id, - roles: roles.roles, - employee_id: user.employee?.id || null, - hrms: hrms, -======= var token = jwt.sign( { exp: Math.floor(Date.now() / 1000) + Number(config.get("auth.access_token_lifetime")), @@ -132,7 +111,6 @@ export class AuthController { roles: roles.roles, hrms: hrms, }, ->>>>>>> f562ccf38baffaa1cb6caf8a196127fe2512c7e4 }, privateKey, { algorithm: "RS256" } diff --git a/src/controllers/user.ts b/src/controllers/user.ts index 9745cd2..5d5a4aa 100644 --- a/src/controllers/user.ts +++ b/src/controllers/user.ts @@ -1,10 +1,6 @@ import axios from "axios" import config from "config" -<<<<<<< HEAD -import { Paging, User, UserRefreshToken, UserRole, HrmsEmployee } from "entity" -======= import { HrmsEmployee, Paging, User, UserRefreshToken, UserRole } from "entity" ->>>>>>> f562ccf38baffaa1cb6caf8a196127fe2512c7e4 import exceljs from "exceljs" import { NextFunction, Response } from "express" import { Request } from "express-jwt"