-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: fixed a bug in the login process for the admin app (#523)
- Loading branch information
Showing
1 changed file
with
5 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,14 @@ | ||
import { pay_transparency_company } from '@prisma/client'; | ||
import axios from 'axios'; | ||
import { NextFunction, Request, Response } from 'express'; | ||
import HttpStatus from 'http-status-codes'; | ||
import jsonwebtoken, { JwtPayload, SignOptions } from 'jsonwebtoken'; | ||
import qs from 'querystring'; | ||
import { config } from '../../config'; | ||
import { KEYCLOAK_IDP_HINT_AZUREIDIR, OIDC_AZUREIDIR_SCOPE } from '../../constants'; | ||
import { | ||
KEYCLOAK_IDP_HINT_AZUREIDIR, | ||
OIDC_AZUREIDIR_SCOPE, | ||
} from '../../constants'; | ||
import { logger as log } from '../../logger'; | ||
import prisma from '../prisma/prisma-client'; | ||
import { utils } from './utils-service'; | ||
|
||
enum LogoutReason { | ||
|
@@ -119,7 +120,7 @@ const adminAuth = { | |
generateUiToken() { | ||
const i = config.get('tokenGenerate:issuer'); | ||
const s = '[email protected]'; | ||
const a = config.get('server:frontend'); | ||
const a = config.get('server:adminFrontend'); | ||
const signOptions: SignOptions = { | ||
issuer: i, | ||
subject: s, | ||
|
@@ -200,8 +201,6 @@ const adminAuth = { | |
return res.status(HttpStatus.OK).json(userInfoFrontend); | ||
}, | ||
|
||
|
||
|
||
async handleCallBackIdir(req: Request): Promise<LogoutReason> { | ||
const userInfo = utils.getSessionUser(req); | ||
const jwtPayload = jsonwebtoken.decode(userInfo.jwt) as JwtPayload; | ||
|