Skip to content

Commit

Permalink
debug condition
Browse files Browse the repository at this point in the history
  • Loading branch information
cekk authored Feb 2, 2024
1 parent 4c73da9 commit 6d245b0
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,14 @@ const applyConfig = (config) => {
// - header user is different from token user
// - token has no expiration
// - token is expired
if (jwtDecode(token).sub !== user || !jwtDecode(token).exp || jwtDecode(token).exp < Date.now() / 1000){
// TODO: eventually add base_url to a relative settings.loginUrl
console.log(jwtDecode(token));
if (user && jwtDecode(token).sub !== user) {
return res.redirect(`${settings.loginUrl}?came_from=${req.url}`);
}
//if (jwtDecode(token).sub !== user || !jwtDecode(token).exp || jwtDecode(token).exp < Date.now() / 1000){
// // TODO: eventually add base_url to a relative settings.loginUrl
// return res.redirect(`${settings.loginUrl}?came_from=${req.url}`);
//}

}
}
Expand Down

0 comments on commit 6d245b0

Please sign in to comment.