Skip to content

Commit

Permalink
fix(github): fix github enterprise authentication
Browse files Browse the repository at this point in the history
  • Loading branch information
lucabertelli committed Oct 24, 2023
1 parent a1f498f commit f1c0cbf
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
9 changes: 5 additions & 4 deletions controllers/auth/read.auth.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -140,15 +140,16 @@ router.get('/github/callback', (req, res, next) => {
userInfo.username = 'userlb'
userInfo.email = 'myemail'

logger.debug('8')
logger.debug(JSON.stringify(userInfo))
logger.info('8')
logger.info(JSON.stringify(userInfo))
const user = authHelpers.cookie(userInfo, 'github')

logger.debug('9')
logger.debug(user)
logger.info('9')
logger.info(user)

res.cookie(envConstants.COOKIE_NAME, jwtHelpers.sign(user), cookieConstants)
res.redirect(global.redirect)
res.status(200)
})

router.get(
Expand Down
5 changes: 1 addition & 4 deletions controllers/user/read.user.controller.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const express = require('express')
const logger = require('../../service-library/helpers/logger.helpers')
// const logger = require('../../service-library/helpers/logger.helpers')
const router = express.Router()

const {
Expand All @@ -10,9 +10,6 @@ const jwtHelpers = require('../../service-library/helpers/jwt.helpers')

router.get('/', async (req, res, next) => {
try {
logger.debug(res)
logger.debug(JSON.stringify(res))

if (!res.locals.identity) {
res.clearCookie(envConstants.COOKIE_NAME, { ...cookieConstants })
res.status(401).send()
Expand Down

0 comments on commit f1c0cbf

Please sign in to comment.