Devise, twitter - ask for confirmation by email

I implemented twitter authentication using an application similar to this: https://github.com/plataformatec/devise/wiki/OmniAuth:-Overview

My question is: since twitter does not give you the email address of the user, how can you redirect the user to the stream:

  • User subscribes via twitter
  • User receives email form
  • User must verify their email address
  • a confirmation link sends the user to a site registered in

Work heavily on C # 3 and # 4. How should I structure my code to allow # 2 to go into # 3 and # 4?

Thanks!

+8
ruby-on-rails omniauth
source share
2 answers

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

User.create(:email => params[:email], :password => params[:password], :password_confirmation => params[:password_confirmation]) 
+3
source share

Ryan Bates covers most of this in his OmniAuth Part 2 screencast to receive email confirmation, all you have to do is add confirmable for development.

+1
source share

All Articles