Class: Devise::OmniauthCallbacksController
- Inherits:
-
DeviseController
- Object
- DeviseController
- Devise::OmniauthCallbacksController
- Defined in:
- app/controllers/devise/omniauth_callbacks_controller.rb
Instance Method Summary collapse
- #after_omniauth_failure_path_for(scope) ⇒ Object protected
- #failed_strategy ⇒ Object protected
- #failure ⇒ Object
- #failure_message ⇒ Object protected
- #passthru ⇒ Object
- #translation_scope ⇒ Object protected
Instance Method Details
#after_omniauth_failure_path_for(scope) ⇒ Object (protected)
29 30 31 |
# File 'app/controllers/devise/omniauth_callbacks_controller.rb', line 29 def after_omniauth_failure_path_for(scope) new_session_path(scope) end |
#failed_strategy ⇒ Object (protected)
17 18 19 |
# File 'app/controllers/devise/omniauth_callbacks_controller.rb', line 17 def failed_strategy request.respond_to?(:get_header) ? request.get_header("omniauth.error.strategy") : request.env["omniauth.error.strategy"] end |
#failure ⇒ Object
10 11 12 13 |
# File 'app/controllers/devise/omniauth_callbacks_controller.rb', line 10 def failure :alert, :failure, kind: OmniAuth::Utils.camelize(failed_strategy.name), reason: redirect_to after_omniauth_failure_path_for(resource_name) end |
#failure_message ⇒ Object (protected)
21 22 23 24 25 26 27 |
# File 'app/controllers/devise/omniauth_callbacks_controller.rb', line 21 def exception = request.respond_to?(:get_header) ? request.get_header("omniauth.error") : request.env["omniauth.error"] error = exception.error_reason if exception.respond_to?(:error_reason) error ||= exception.error if exception.respond_to?(:error) error ||= (request.respond_to?(:get_header) ? request.get_header("omniauth.error.type") : request.env["omniauth.error.type"]).to_s error.to_s.humanize if error end |
#passthru ⇒ Object
6 7 8 |
# File 'app/controllers/devise/omniauth_callbacks_controller.rb', line 6 def passthru render status: 404, plain: "Not found. Authentication passthru." end |
#translation_scope ⇒ Object (protected)
33 34 35 |
# File 'app/controllers/devise/omniauth_callbacks_controller.rb', line 33 def translation_scope 'devise.omniauth_callbacks' end |