This commit is contained in:
Narul Hidayah
2026-01-02 23:28:52 +07:00
parent c150725e3f
commit ee4cf8a43e
2 changed files with 0 additions and 26 deletions

View File

@ -46,19 +46,11 @@ export class AuthController {
const userRepository = OrmHelper.DB.getRepository(User) const userRepository = OrmHelper.DB.getRepository(User)
const userRefreshTokenRepository = OrmHelper.DB.getRepository(UserRefreshToken) 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({ const user = await userRepository.findOne({
relations: ["roles", "roles.application"], relations: ["roles", "roles.application"],
select: ["id", "email", "name", "password", "username", "roles"], select: ["id", "email", "name", "password", "username", "roles"],
where: { username: param.username }, where: { username: param.username },
}) })
>>>>>>> f562ccf38baffaa1cb6caf8a196127fe2512c7e4
if (user != null && user.roles != null && user.roles.length > 0 && user.checkIfPasswordMatch(param.password)) { if (user != null && user.roles != null && user.roles.length > 0 && user.checkIfPasswordMatch(param.password)) {
const { browser, device, os } = UAParser(req.get("User-Agent")) 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") 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( var token = jwt.sign(
{ {
exp: Math.floor(Date.now() / 1000) + Number(config.get("auth.access_token_lifetime")), exp: Math.floor(Date.now() / 1000) + Number(config.get("auth.access_token_lifetime")),
@ -132,7 +111,6 @@ export class AuthController {
roles: roles.roles, roles: roles.roles,
hrms: hrms, hrms: hrms,
}, },
>>>>>>> f562ccf38baffaa1cb6caf8a196127fe2512c7e4
}, },
privateKey, privateKey,
{ algorithm: "RS256" } { algorithm: "RS256" }

View File

@ -1,10 +1,6 @@
import axios from "axios" import axios from "axios"
import config from "config" import config from "config"
<<<<<<< HEAD
import { Paging, User, UserRefreshToken, UserRole, HrmsEmployee } from "entity"
=======
import { HrmsEmployee, Paging, User, UserRefreshToken, UserRole } from "entity" import { HrmsEmployee, Paging, User, UserRefreshToken, UserRole } from "entity"
>>>>>>> f562ccf38baffaa1cb6caf8a196127fe2512c7e4
import exceljs from "exceljs" import exceljs from "exceljs"
import { NextFunction, Response } from "express" import { NextFunction, Response } from "express"
import { Request } from "express-jwt" import { Request } from "express-jwt"