From b3dcec17c0fb7d4f3b5263d604343f8aef214b93 Mon Sep 17 00:00:00 2001 From: JBB0807 <104856796+JBB0807@users.noreply.github.com> Date: Fri, 2 May 2025 17:19:47 -0700 Subject: [PATCH] bug fix for login via google --- auth-service/passport.js | 3 ++- auth-service/routes/auth.js | 2 +- user-db-service/.env | 6 +++--- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/auth-service/passport.js b/auth-service/passport.js index 1b6b835..1448a9d 100644 --- a/auth-service/passport.js +++ b/auth-service/passport.js @@ -60,9 +60,10 @@ passport.serializeUser((user, done) => { // done(null, user); console.log("Serializing user:", user); done(null, { - id: user.assignmentid || user.emal, + id: user.assignmentid || user.id, displayName: user.studentname || user.displayName, role: user.role, + emails: user.emails || "none", }); }); diff --git a/auth-service/routes/auth.js b/auth-service/routes/auth.js index 47e848b..05d5f63 100644 --- a/auth-service/routes/auth.js +++ b/auth-service/routes/auth.js @@ -73,7 +73,7 @@ router.post( console.log('is authenticated?: ' + req.isAuthenticated()); - return res.json({ + return res.status(200).json({ success: true, message: 'Successful Login', user: req.user diff --git a/user-db-service/.env b/user-db-service/.env index 3aaa685..52a3ca1 100644 --- a/user-db-service/.env +++ b/user-db-service/.env @@ -5,8 +5,8 @@ # See the documentation for all the connection string options: https://pris.ly/d/connection-strings #use this when testing local, remmber to run the proxy command -# DATABASE_URL="postgresql://postgres:wly9H8gjjmxYfg1@localhost:15432/postgres?schema=public" +DATABASE_URL="postgresql://postgres:wly9H8gjjmxYfg1@localhost:15432/postgres?schema=public" -DATABASE_URL="postgres://postgres:wly9H8gjjmxYfg1@bytecamp-db.flycast:5432?sslmode=disable" +# DATABASE_URL="postgres://postgres:wly9H8gjjmxYfg1@bytecamp-db.flycast:5432?sslmode=disable" # DATABASE_URL=postgres://snakebyte:zVB7lgOiKr89dq6@localhost:5432/snakebyte?sslmode=disable -NODE_PORT=3000 +NODE_PORT=3100