Skip to content

Commit

Permalink
- authorization: cookie should have higher priority
Browse files Browse the repository at this point in the history
- redirect to ui after login
  • Loading branch information
cgawron committed Mar 13, 2024
1 parent 2fd2677 commit 73563ad
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) => {
Expand All @@ -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);
Expand Down

0 comments on commit 73563ad

Please sign in to comment.