Forum: Ruby on Rails Twitter omniauth login; email can't be blank

8471d26e8d9c2c6b09286028b276d627?d=identicon&s=25 Soichi Ishida (soichi)
on 2012-12-16 02:22
Rails 3.1.3
devise 2.1.2
omniauth-twitter (0.0.14)

I am trying to setup Twitter omniauth login.
But Twitter API does not return email from its server, so I need to pass
email from somewhere.

Since my app already has its own login process, which requires users to
input email and to proceed to confirmation, getting email from there
seems reasonable.


Currently, if users try to login using Twitter account directly (without
the account that the app can create), it raises an error

1 error t('registrations.new.prohibited'):
Email can't be blank

Twitter API returns 'nickname' , which is filled in the username field
along with the error above.

If I try to fill the email field below the username field and click sign
up, it raises the same error, having the email field emptied.

Devise controller is hidden somewhere, I need to override it somehow in
order to pass emails from input form.

Question:
Could anyone show me how to pass email to devise controller in case of
Twitter omniauth login?
If there is a better way, it will be nice.

soichi
Please log in before posting. Registration is free and takes only a minute.
Existing account

NEW: Do you have a Google/GoogleMail, Yahoo or Facebook account? No registration required!
Log in with Google account | Log in with Yahoo account | Log in with Facebook account
No account? Register here.