From a7e7285e118c28e2a22a3a059c7ed85c9d492c85 Mon Sep 17 00:00:00 2001 From: lucabertelli Date: Tue, 24 Oct 2023 21:45:51 +0200 Subject: [PATCH] fix(github): fix github enterprise authentication --- controllers/auth/read.auth.controller.js | 26 ++++++++++++++---------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/controllers/auth/read.auth.controller.js b/controllers/auth/read.auth.controller.js index 57aafd7..5dca1b6 100644 --- a/controllers/auth/read.auth.controller.js +++ b/controllers/auth/read.auth.controller.js @@ -131,20 +131,24 @@ router.get('/github/callback', async (req, res, next) => { userInfo.displayName = json.name userInfo.username = json.login userInfo.email = json.email - }) - .catch((err) => console.log(err)) - }) - logger.info('8') - logger.info(JSON.stringify(userInfo)) - const user = authHelpers.cookie(userInfo, 'github') + logger.info('8') + logger.info(JSON.stringify(userInfo)) + const user = authHelpers.cookie(userInfo, 'github') - logger.info('9') - logger.info(user) + logger.info('9') + logger.info(user) - res.cookie(envConstants.COOKIE_NAME, jwtHelpers.sign(user), cookieConstants) - res.redirect(global.redirect) - res.status(200) + res.cookie( + envConstants.COOKIE_NAME, + jwtHelpers.sign(user), + cookieConstants + ) + res.redirect(global.redirect) + res.status(200) + }) + .catch((err) => console.log(err)) + }) }) router.get(