0
Passport JSを使用してGoogleから更新トークンを取得できません。私は自分のアカウントのアクセス権を削除して、初めてのログインであることを確認しています。私はトークンの "未定義"を取得し続けます。ここに私が今あるコードがあります。PassportJSとNode.jSを使用してGoogle OAuth 2.0の更新トークンを取得する
Passport.use(new GoogleStrategy({
clientID: "xxxxx.apps.googleusercontent.com",
clientSecret: "xxxxx",
callbackURL: `https://localhost:${port}/auth/google/callback`,
accessType: 'offline',
passReqToCallback: true
},
function(req,accessToken, refreshToken, profile, done) {
var tokens = {
access_token: accessToken,
refresh_token: refreshToken
}
console.log(tokens)
oauth2Client.setCredentials(tokens);
done(err = false, user = true)
}));
、誰もがそれが大幅