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?
Just add
accessType: 'offline'inside the authenticate function input object.