0
ExpressJS 웹 응용 프로그램에서 PassportJS를 사용하고 있습니다. app.js에서PassportJS/ExpressJS에서 IP 가져 오기
:
//passportjs google
passport.use(new GoogleStrategy({
clientID: '...',
clientSecret: '...',
callbackURL: '...'
}, user.oauth2Login
));
app.get('/auth/google',
passport.authenticate('google', { scope: 'email' }));
app.get('/auth/google/callback',
passport.authenticate('google', { successReturnToOrRedirect: '/home', failureRedirect: '/login' }))
내 사용자 modulue에서 :
exports.oauth2Login = function(accessToken, refreshToken, profile, done) {
//get ip here
}
어떻게 oauth2Login
에서 사용자의 IP를받을 수 있나요?