From 002653b3039c4426ccb543ecab740501cfe04756 Mon Sep 17 00:00:00 2001
From: Federico Hurtado <fed_home@Federicos-Mac-mini.local>
Date: Wed, 30 Oct 2024 12:37:16 -0400
Subject: [PATCH] Fix bug in CAS log in logging.

---
 backend/config/auth/auth.login.js | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/backend/config/auth/auth.login.js b/backend/config/auth/auth.login.js
index be9e971..f93c40e 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);
       }
-- 
GitLab