An attempt to configure facebook authentication using devise, omniauth (including facebook-omniauth) in an application hosted on the hero. The facebook API call works, but after the callback, I canβt miss the confirmation step.
I followed the github tutorial on omniauth: https://github.com/plataformatec/devise/wiki/OmniAuth:-Overview
and also read and tried to implement this: Come up with skip_confirmation! does not work
But I save the following error in my heroku log:
NoMethodError (undefined method `skip_confirmation!')
This is what my devise.rb looks like:
config.omniauth :facebook, "API_KEY", "API_SECRET" {:strategy_class => OmniAuth::Strategies::Facebook, :scope => 'email, offline_access', :client_options => {:ssl => {:ca_file => '/usr/lib/ssl/certs/ca-certificates.crt'}}}
Here is my omniauth_callbacks_controller.rb:
class Users::OmniauthCallbacksController < Devise::OmniauthCallbacksController def facebook
Here is my user.rb model:
def self.find_for_facebook_oauth(auth, signed_in_resource=nil) user = User.where(:provider => auth.provider, :uid => auth.uid).first unless user user = User.new(name:auth.extra.raw_info.name, provider:auth.provider, uid:auth.uid, email:auth.info.email, password:Devise.friendly_token[0,20], ) user.skip_confirmation! user.save end user end
Thank you for your help!
Patrice navarre
source share