我正在使用passport-google-oauth,我需要得到refreshToken。它通常返回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",
})
);我浏览过互联网,并且有一些旧的添加accessType: "offline"的解决方案。但是在这个版本的passport中似乎没有accessType。做什么?
发布于 2022-09-15 07:14:39
只需在身份验证函数输入对象中添加accessType: 'offline'即可。
app.get('/auth/google',
passport.authenticate('google', {
scope : ['profile', 'email'],
accessType: 'offline'
})
);https://stackoverflow.com/questions/71780029
复制相似问题