Skip to content
Snippets Groups Projects
Commit 002653b3 authored by Federico Hurtado's avatar Federico Hurtado
Browse files

Fix bug in CAS log in logging.

parent 023f7e16
No related branches found
No related tags found
No related merge requests found
...@@ -65,9 +65,11 @@ const casLogin = async function (req, res, next) { ...@@ -65,9 +65,11 @@ const casLogin = async function (req, res, next) {
return next(err); return next(err);
} }
console.log("User: ", user);
// payload for the JWT token // payload for the JWT token
const payload = { const payload = {
id: user.id, id: user.userID,
role: user.permissionLevel || "guest", role: user.permissionLevel || "guest",
username: user.username, username: user.username,
}; };
...@@ -78,7 +80,7 @@ const casLogin = async function (req, res, next) { ...@@ -78,7 +80,7 @@ const casLogin = async function (req, res, next) {
// document a successful login // document a successful login
try { try {
const timestamp = new Date(); // Current timestamp const timestamp = new Date(); // Current timestamp
await documentSuccessfulLogin(user.id, timestamp); await documentSuccessfulLogin(user.userID, timestamp);
} catch (error) { } catch (error) {
console.error("Error logging the successful login: ", error); console.error("Error logging the successful login: ", error);
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment