Class: Users::OmniauthCallbacksController

Inherits:
Devise::OmniauthCallbacksController
  • Object
show all
Defined in:
lib/kitty_gen/templates/login_with_facebook_and_twitter/omniauth_callbacks_controller.rb

Instance Method Summary collapse

Instance Method Details

#facebookObject



3
4
5
6
7
8
9
10
11
12
13
14
# File 'lib/kitty_gen/templates/login_with_facebook_and_twitter/omniauth_callbacks_controller.rb', line 3

def facebook
  # You need to implement the method below in your model
  @user = User.find_for_facebook_oauth(env["omniauth.auth"], current_user)

  if @user.persisted?
    flash[:notice] = I18n.t "devise.omniauth_callbacks.success", :kind => "Facebook"
     @user, :event => :authentication
  else
    session["devise.facebook_data"] = env["omniauth.auth"]
    redirect_to new_user_registration_url
  end
end

#passthruObject



16
17
18
# File 'lib/kitty_gen/templates/login_with_facebook_and_twitter/omniauth_callbacks_controller.rb', line 16

def passthru
  render :file => "#{Rails.root}/public/404.html", :status => 404, :layout => false
end