Class: Intra::OmniAuthFailureApp
- Inherits:
-
Object
- Object
- Intra::OmniAuthFailureApp
- Defined in:
- lib/intra/omniauth_failure_app.rb
Instance Attribute Summary collapse
-
#env ⇒ Object
readonly
Returns the value of attribute env.
Instance Method Summary collapse
- #call ⇒ Object
- #error_description ⇒ Object
-
#initialize(env) ⇒ OmniAuthFailureApp
constructor
A new instance of OmniAuthFailureApp.
- #message_key ⇒ Object
- #new_path ⇒ Object
Constructor Details
#initialize(env) ⇒ OmniAuthFailureApp
Returns a new instance of OmniAuthFailureApp.
5 6 7 |
# File 'lib/intra/omniauth_failure_app.rb', line 5 def initialize(env) @env = env end |
Instance Attribute Details
#env ⇒ Object (readonly)
Returns the value of attribute env.
3 4 5 |
# File 'lib/intra/omniauth_failure_app.rb', line 3 def env @env end |
Instance Method Details
#call ⇒ Object
9 10 11 12 |
# File 'lib/intra/omniauth_failure_app.rb', line 9 def call Logger.logger.info "OmniAuthFailureApp #{}=#{error_description}" Rack::Response.new(['302 Moved'], 302, 'Location' => new_path).finish end |
#error_description ⇒ Object
23 24 25 |
# File 'lib/intra/omniauth_failure_app.rb', line 23 def error_description Rack::Utils.escape(env['omniauth.error'].error_reason) end |
#message_key ⇒ Object
19 20 21 |
# File 'lib/intra/omniauth_failure_app.rb', line 19 def env['omniauth.error.type'] end |
#new_path ⇒ Object
14 15 16 17 |
# File 'lib/intra/omniauth_failure_app.rb', line 14 def new_path "#{env['SCRIPT_NAME']}#{OmniAuth.config.path_prefix}/failure?" \ "message=#{}&error_description=#{error_description}" end |