confirmable + omniauthable, skip confirmation if OAuth sign-up Options


In the find_for_facebook_oauth action in the User model , I used the
confirm! before saving it…

def self.find_for_facebook_oauth(access_token,
signed_in_resource=nil)
data = access_token[‘extra’][‘user_hash’]
if user = User.find_by_email(data[“email”])
user
else # Create an user with a stub password.
user = User.new(:email => data[“email”], :password =>
Devise.friendly_token[0,20],  :agreement_status => true)
user.confirm!
user.save!
user
end
end

http://groups.google.com/group/plataformatec-devise/browse_thread/thread/9d36b3ea8e1f3d96?pli=1

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s