Class: Devise::Auth0CallbacksController

Inherits:
OmniauthCallbacksController
  • Object
show all
Defined in:
app/controllers/devise/auth0_callbacks_controller.rb

Instance Method Summary collapse

Instance Method Details

#callbackObject



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

def callback
  user = resource_class.from_auth0_omniauth(request.env["omniauth.auth"])

  if user&.persisted?
    set_flash_message(:notice, :success, kind: "Auth0") if is_navigational_format?
    (user, event: :authentication)
  else
    session["devise.auth0_data"] = request.env["omniauth.auth"].except(:extra)
    redirect_to(after_omniauth_callback_path_for(resource_name))
  end
end