main
alex 2024-01-14 13:47:36 +01:00
parent d77ef338c9
commit 8cfaa0e8d6
2 changed files with 3 additions and 1 deletions

View File

@ -57,6 +57,8 @@ app.use(
}) })
); );
app.use(passport.authenticate("session"));
passport.use( passport.use(
new GoogleStrategy.Strategy( new GoogleStrategy.Strategy(
{ {
@ -68,6 +70,7 @@ 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

@ -9,7 +9,6 @@ router.get(
"/auth/google", "/auth/google",
passport.authenticate("google", { passport.authenticate("google", {
accessType: "offline", accessType: "offline",
session: false,
scope: [ scope: [
"https://www.googleapis.com/auth/calendar.app.created", "https://www.googleapis.com/auth/calendar.app.created",
"https://www.googleapis.com/auth/calendar.events.freebusy", "https://www.googleapis.com/auth/calendar.events.freebusy",