Don't return user email when app has permission "email"
arazumoff opened this issue · comments
Don't return user email when app has permission "email" with get access_token
you must use 5 arguments in callback function or 6 if passReqToCallback: true
Here's an example (params
):
passport.use(new VKontakteStrategy({
clientID: VKONTAKTE_APP_ID, // VK.com docs call it 'API ID'
clientSecret: VKONTAKTE_APP_SECRET,
callbackURL: "http://localhost:3000/auth/vkontakte/callback"
},
function(accessToken, refreshToken, params, profile, done) {
console.log(params.email);
}
));
@xxsanekxx this is correct, thanks. This may be closed.
Thank you! It works
@ArtemKolodko BTW vk.com is still some times may not return email (for unknown reason), so you should handle this situation.
@whitecolor maybe, it happens when VK user use cellphone number for login only? VK supports cellphone number or email as username
@ArtemKolodko yeah, it seems you are right.