Skip to content

Commit

Permalink
debug
Browse files Browse the repository at this point in the history
  • Loading branch information
cekk authored Feb 2, 2024
1 parent ec716cd commit 711ae07
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,10 @@ const applyConfig = (config) => {
// - token has no expiration
// - token is expired
console.log(jwtDecode(token));
console.log("espressione: ", (jwtDecode(token).sub !== user || !jwtDecode(token).exp || jwtDecode(token).exp < Date.now() / 1000));
console.log("jwtDecode(token).sub !== user => ", jwtDecode(token).sub !== user);
console.log("!jwtDecode(token).exp => ", !jwtDecode(token).exp);
console.log("jwtDecode(token).exp < Date.now() / 1000) => ", jwtDecode(token).exp < Date.now() / 1000))
console.log("espressione finale: ", (jwtDecode(token).sub !== user || !jwtDecode(token).exp || jwtDecode(token).exp < Date.now() / 1000));
if (user && jwtDecode(token).sub !== user) {
return res.redirect(`${settings.loginUrl}?came_from=${req.url}`);
}
Expand Down

0 comments on commit 711ae07

Please sign in to comment.