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