Sha256: a9d4f2a1d8785109dfb0ce5128f73b959a3f8b3155747455a1bf14cc3ce6cf56

Contents?: true

Size: 846 Bytes

Versions: 3

Compression:

Stored size: 846 Bytes

Contents

class OmniauthCallbacksController < Devise::OmniauthCallbacksController
  def facebook
    @user = User.find_for_oauth(env["omniauth.auth"], current_user)
    if @user.persisted?
      sign_in_and_redirect @user, :event => :authentication
      set_flash_message(:notice, :success, :kind => "Facebook") if is_navigational_format?
    else
      session["devise.facebook_data"] = env["omniauth.auth"]
      redirect_to new_user_registration_url
    end
  end

  def infinum
    @user = User.find_for_oauth(env["omniauth.auth"], current_user)
    if @user.persisted?
      sign_in_and_redirect @user, :event => :authentication
      set_flash_message(:notice, :success, :kind => "Infinum") if is_navigational_format?
    else
      session["devise.infinum_data"] = env["omniauth.auth"]
      redirect_to new_user_registration_url
    end
  end

end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
omniauth-infinum-0.11.1 examples/omniauth_infinum_with_facebook/app/controllers/omniauth_callbacks_controller.rb
omniauth-infinum-0.10.0 examples/omniauth_infinum_with_facebook/app/controllers/omniauth_callbacks_controller.rb
omniauth-infinum-0.10.1 examples/omniauth_infinum_with_facebook/app/controllers/omniauth_callbacks_controller.rb