Indeed, this method does not directly provide the email address. However, there is an alternative approach using OAuth (see vk.com/dev/auth_sites), where the email is included in the GET parameters along with the token.
If you're working with Coffeescript/Javascript, you can utilize window.open(...) to initiate the process.
const appId = 'your app id';
const redirectUri = 'your redirect uri';
const url = 'https://oauth.vk.com/authorize?client_id='+appId+'&display=popup&redirect_uri='+redirectUri+'&response_type=token&scope=email';
const newWin = window.open(url, 'vk-login', 'width=665,height=370');
Afterwards, there are two ways to retrieve the email:
- Implement a redirect URI handler on your server side.
- Perform redirects within your site and continuously monitor newWin.location.href. Once it contains your specified redirection URI, extract the email parameter accordingly (client side approach).