'accessType missing in passport.authenticate

I am using passport-google-oauth and I need to get the refreshToken. It normally returns undefined.

app.get(
  "/auth/google",
  passport.authenticate("google", {
    scope: [
      "https://www.googleapis.com/auth/userinfo.profile",
      "https://www.googleapis.com/auth/userinfo.email",
    ],
    prompt: "consent",
  })
);

I've browsed the internet, and there were old solutions of adding accessType: "offline". But it seems like in this version of passport there is no accessType. What do?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source