main
alex 2024-01-14 13:50:13 +01:00
parent 3005000a77
commit c0132f906c
2 changed files with 12 additions and 5 deletions

View File

@ -70,7 +70,6 @@ passport.use(
"https://www.googleapis.com/auth/calendar.events.freebusy", "https://www.googleapis.com/auth/calendar.events.freebusy",
], ],
skipUserProfile: true, // this is important, if not set to true, an error will be thrown skipUserProfile: true, // this is important, if not set to true, an error will be thrown
state: true,
}, },
(accessToken, refreshToken, profile, cb) => { (accessToken, refreshToken, profile, cb) => {
console.log("accessToken", accessToken); console.log("accessToken", accessToken);

View File

@ -20,10 +20,18 @@ router.get(
"/auth/google/callback", "/auth/google/callback",
passport.authenticate( passport.authenticate(
"google", "google",
passport.authenticate("google", { passport.authenticate(
"google",
{
successReturnToOrRedirect: "/", successReturnToOrRedirect: "/",
failureRedirect: "/login", failureRedirect: "/login",
}) },
(err, user, info) => {
logger.info("err", err);
logger.info("user", user);
logger.info("info", info);
}
)
) )
); );