Class: Underworld::Omniauth::CallbacksController

Inherits:
Devise::OmniauthCallbacksController
  • Object
show all
Includes:
Callbacks
Defined in:
app/controllers/underworld/omniauth/callbacks_controller.rb

Instance Method Summary collapse

Methods included from Callbacks

#default_service_callback

Instance Method Details

#facebookObject

Create a method for each service you want to override If you do not provide a method a default one will used Here is facebook method for an example



8
9
10
11
12
13
14
15
16
17
18
# File 'app/controllers/underworld/omniauth/callbacks_controller.rb', line 8

def facebook
  create_or_find_user

  if @user.persisted?
     @user, :event => :authentication #this will throw if @user is not activated
    set_flash_message(:notice, :success, :kind => "Facebook") if is_navigational_format?
  else
    session["devise.facebook_data"] = request.env["omniauth.auth"]
    redirect_to new_user_registration_url
  end
end