Class: GDS::SSO::FailureApp

Inherits:
ActionController::Metal
  • Object
show all
Includes:
ActionController::HttpAuthentication::Basic::ControllerMethods, ActionController::RackDelegation, ActionController::Redirecting, ActionController::UrlFor
Defined in:
lib/gds-sso/failure_app.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.call(env) ⇒ Object



15
16
17
18
19
# File 'lib/gds-sso/failure_app.rb', line 15

def self.call(env)
  if ! ::GDS::SSO::ApiAccess.api_call?(env)
    action(:redirect).call(env)
  end
end

Instance Method Details

#redirectObject



21
22
23
24
# File 'lib/gds-sso/failure_app.rb', line 21

def redirect
  store_location!
  redirect_to '/auth/gds'
end

#store_location!Object

TOTALLY NOT DOING THE SCOPE THING. PROBABLY SHOULD.



32
33
34
# File 'lib/gds-sso/failure_app.rb', line 32

def store_location!
  session["return_to"] = env['warden.options'][:attempted_path] if request.get?
end