Class: Users::OmniauthCallbacksController

Inherits:
Devise::OmniauthCallbacksController
  • Object
show all
Defined in:
app/controllers/users/omniauth_callbacks_controller.rb

Instance Method Summary collapse

Instance Method Details

#failureObject



17
18
19
# File 'app/controllers/users/omniauth_callbacks_controller.rb', line 17

def failure
  redirect_to root_path
end

#openid_connectObject



5
6
7
8
9
10
11
12
13
14
15
# File 'app/controllers/users/omniauth_callbacks_controller.rb', line 5

def openid_connect
  @user = Custom::OidcUser.from_omniauth(request.env["omniauth.auth"])

  if @user.persisted? && @user.errors.empty?
     @user, event: :authentication # this will throw if @user is not activated
    set_flash_message(:notice, :success, kind: "OpenIDConnect") if is_navigational_format?
  else
    # session["devise.facebook_data"] = request.env["omniauth.auth"].except(:extra) # Removing extra as it can overflow some session stores
    redirect_to new_user_registration_url
  end
end