bug fix for login via google

This commit is contained in:
JBB0807 2025-05-02 17:19:47 -07:00
parent adb005ae33
commit b3dcec17c0
3 changed files with 6 additions and 5 deletions

View file

@ -60,9 +60,10 @@ passport.serializeUser((user, done) => {
// done(null, user); // done(null, user);
console.log("Serializing user:", user); console.log("Serializing user:", user);
done(null, { done(null, {
id: user.assignmentid || user.emal, id: user.assignmentid || user.id,
displayName: user.studentname || user.displayName, displayName: user.studentname || user.displayName,
role: user.role, role: user.role,
emails: user.emails || "none",
}); });
}); });

View file

@ -73,7 +73,7 @@ router.post(
console.log('is authenticated?: ' + req.isAuthenticated()); console.log('is authenticated?: ' + req.isAuthenticated());
return res.json({ return res.status(200).json({
success: true, success: true,
message: 'Successful Login', message: 'Successful Login',
user: req.user user: req.user

View file

@ -5,8 +5,8 @@
# See the documentation for all the connection string options: https://pris.ly/d/connection-strings # 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 #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 # DATABASE_URL=postgres://snakebyte:zVB7lgOiKr89dq6@localhost:5432/snakebyte?sslmode=disable
NODE_PORT=3000 NODE_PORT=3100