From 73563ad99c6fef48d1580eb12c5634dee626ef27 Mon Sep 17 00:00:00 2001 From: Christian Gawron Date: Wed, 13 Mar 2024 10:27:31 +0000 Subject: [PATCH] - authorization: cookie should have higher priority - redirect to ui after login --- index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index d25a61a..fa5713b 100644 --- a/index.js +++ b/index.js @@ -65,7 +65,7 @@ app.get('/callback', async (req, res) => { const token = tokenSet.id_token;//jwt.sign({ user }, 'your_secret_key'); res.cookie('token', token); - res.redirect(BASE_URL + '/dashboard'); + res.redirect(BASE_URL); }); app.get('/dashboard', (req, res) => { @@ -91,7 +91,7 @@ app.get('/dashboard', (req, res) => { app.use((req, res, next) => { let token = req.cookies.token; - if (req.headers.authorization) { + if (!token && req.headers.authorization) { token = req.headers.authorization.split(' ')[1]; } console.log('token', token);