From f1c0cbf207d7431be901d33edea2201068fbc633 Mon Sep 17 00:00:00 2001 From: lucabertelli Date: Tue, 24 Oct 2023 21:04:45 +0200 Subject: [PATCH] fix(github): fix github enterprise authentication --- controllers/auth/read.auth.controller.js | 9 +++++---- controllers/user/read.user.controller.js | 5 +---- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/controllers/auth/read.auth.controller.js b/controllers/auth/read.auth.controller.js index 5933ac8..bf1f667 100644 --- a/controllers/auth/read.auth.controller.js +++ b/controllers/auth/read.auth.controller.js @@ -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( diff --git a/controllers/user/read.user.controller.js b/controllers/user/read.user.controller.js index 604d3c7..c0d3594 100644 --- a/controllers/user/read.user.controller.js +++ b/controllers/user/read.user.controller.js @@ -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 { @@ -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()