Module: Bpluser::Users::OmniauthCallbacksController::InstanceMethods
- Defined in:
- app/controllers/bpluser/users/omniauth_callbacks_controller.rb
Instance Method Summary collapse
Instance Method Details
#facebook ⇒ Object
35 36 37 38 39 40 41 42 43 44 45 46 |
# File 'app/controllers/bpluser/users/omniauth_callbacks_controller.rb', line 35 def facebook # You need to implement the method below in your model (e.g. app/models/user.rb) @user = User.find_for_facebook_oauth(request.env["omniauth.auth"], current_user) if @user.persisted? sign_in_and_redirect @user, :event => :authentication #this will throw if @user is not activated (:notice, :success, :kind => "Facebook") if else session["devise.facebook_data"] = request.env["omniauth.auth"] redirect_to new_user_registration_url end end |
#ldap ⇒ Object
11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'app/controllers/bpluser/users/omniauth_callbacks_controller.rb', line 11 def ldap @user = User.find_for_ldap_oauth(request.env["omniauth.auth"], current_user) if @user.persisted? flash[:notice] = I18n.t "devise.omniauth_callbacks.success", :kind => "Ldap" sign_in_and_redirect @user, :event => :authentication else session["devise.ldap_data"] = request.env["omniauth.auth"] redirect_to new_user_registration_url end end |
#polaris ⇒ Object
24 25 26 27 28 29 30 31 32 33 |
# File 'app/controllers/bpluser/users/omniauth_callbacks_controller.rb', line 24 def polaris @user = User.find_for_polaris_oauth(request.env["omniauth.auth"], current_user) if @user.persisted? flash[:notice] = I18n.t "devise.omniauth_callbacks.success", :kind => "Polaris" sign_in_and_redirect @user, :event => :authentication else session["devise.polaris_data"] = request.env["omniauth.auth"] redirect_to new_user_registration_url end end |