diff --git a/backend/config/auth/auth.login.js b/backend/config/auth/auth.login.js index be9e9710fc7632d5464a6ddd26d3638bdb6a05dc..f93c40e06ec2694300160f0292de3e6dc178246f 100644 --- a/backend/config/auth/auth.login.js +++ b/backend/config/auth/auth.login.js @@ -65,9 +65,11 @@ const casLogin = async function (req, res, next) { return next(err); } + console.log("User: ", user); + // payload for the JWT token const payload = { - id: user.id, + id: user.userID, role: user.permissionLevel || "guest", username: user.username, }; @@ -78,7 +80,7 @@ const casLogin = async function (req, res, next) { // document a successful login try { const timestamp = new Date(); // Current timestamp - await documentSuccessfulLogin(user.id, timestamp); + await documentSuccessfulLogin(user.userID, timestamp); } catch (error) { console.error("Error logging the successful login: ", error); }