Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Devise, twitter - ask for confirmation email

I have implemented twitter authentication with devise using something very similar to this: https://github.com/plataformatec/devise/wiki/OmniAuth:-Overview

My question is, since twitter doesn't give you the email of the user, how can you direct the user back to the flow of:

  1. User signs in with twitter
  2. User is presented with an email form
  3. User needs to confirm his/her email
  4. clicking confirmation link sends user to site logged in

Devise pretty much takes care with #3 and #4. How should I structure my code to allow #2 to transit into #3 and #4?

Thanks!

like image 364
disappearedng Avatar asked Sep 17 '11 09:09

disappearedng


People also ask

Does Twitter ask for email verification?

Complete: Your account must have a profile name, and a profile image; Active use: Your account must be public at the time of application and you must have logged into that account in the last six months; Security: Your account must have a confirmed email address or phone number; and.

How do I verify my email for Twitter?

When you add or change the email address attached to your account, we'll send you an email asking you to confirm the change. In the email we send, clicking the Confirm now button lets us know the email address is yours.

Why am I not receiving a confirmation code from Twitter?

I didn't receive the SMS code If you're logged in, verify that your phone is turned on correctly in your Mobile settings. If you recently changed your phone number or mobile carrier, you will need to update your settings. You may do so through the web, iOS, or Android apps if you are still logged in.


1 Answers

Show new user form in twitter callback page. Store twitter token in hidden field. Then you can create new user in your controller and do what you want with the twitter token. User.create also sends confirmation email.

User.create(:email => params[:email], :password => params[:password], :password_confirmation => params[:password_confirmation])
like image 193
emrahbasman Avatar answered Sep 20 '22 20:09

emrahbasman