arunagw / omniauth-twitter

OmniAuth strategy for Twitter
http://arunagw.github.io/omniauth-twitter/
578 stars 166 forks source link

How can I access email address ? #129

Closed SidharthBansal closed 6 years ago

SidharthBansal commented 6 years ago

The request.env['omniauth.auth'] doesn't create email field. But stackoverflow shows that there is a way to fetch email addresses via twitter. Can anyone help me how to fetch it? I am not using devise. I have made my own login system

truongnmt commented 6 years ago

You have to fill your app's Privacy Policy URL and Terms of Service URL (just fill random link if you don't have yet), then head to Permission tab and choose Request email addresses from users. And yes, this is only configuration on your app, not relate to either devise or omniauth.

SidharthBansal commented 6 years ago

I want to know the place where it is stored inside the hash. Is it hash[info][email]?

truongnmt commented 6 years ago

I'm not sure, use debug and you can find out.

raysrashmi commented 6 years ago

@SidharthBansal You can get the email in request.env['omniauth.auth'][:info][:email]