Module: Aker::Modes::Support::AttemptedPath

Included in:
Cas::ServiceMode, Form::Mode
Defined in:
lib/aker/modes/support/attempted_path.rb

Overview

If a user fails authentication, the URL that user was trying to access is stored in the ‘:attempted_path` key in the `warden.options` environment variable.

AttemptedPath provides code to extract the attempted path that can be shared amongst objects that need this information.

Instance Method Summary collapse

Instance Method Details

#attempted_pathString?

Returns the path that a user was trying to access.

Returns:

  • (String, nil)

    a String if a path exists, nil otherwise



16
17
18
19
20
# File 'lib/aker/modes/support/attempted_path.rb', line 16

def attempted_path
  if env['warden.options']
    env['warden.options'][:attempted_path]
  end
end