Class: Otto::Security::Authentication::AuthFailure

Inherits:
Data
  • Object
show all
Defined in:
lib/otto/security/authentication/auth_failure.rb

Overview

Failure result for authentication failures

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#auth_methodObject (readonly)

Returns the value of attribute auth_method

Returns:

  • (Object)

    the current value of auth_method



9
10
11
# File 'lib/otto/security/authentication/auth_failure.rb', line 9

def auth_method
  @auth_method
end

#failure_reasonObject (readonly)

Returns the value of attribute failure_reason

Returns:

  • (Object)

    the current value of failure_reason



9
10
11
# File 'lib/otto/security/authentication/auth_failure.rb', line 9

def failure_reason
  @failure_reason
end

Instance Method Details

#anonymous?Boolean

Check if anonymous - always true for failures

Returns:

  • (Boolean)

    True (failures have no user)



24
25
26
# File 'lib/otto/security/authentication/auth_failure.rb', line 24

def anonymous?
  true
end

#authenticated?Boolean

Check if authenticated - always false for failures

Returns:

  • (Boolean)

    False (failures are never authenticated)



17
18
19
# File 'lib/otto/security/authentication/auth_failure.rb', line 17

def authenticated?
  false
end

#inspectString

Create a string representation for debugging

Returns:

  • (String)

    Debug representation



38
39
40
# File 'lib/otto/security/authentication/auth_failure.rb', line 38

def inspect
  "#<AuthFailure reason=#{failure_reason.inspect} method=#{auth_method}>"
end

#user_contextHash

Get empty user context for failures

Returns:

  • (Hash)

    Empty hash



31
32
33
# File 'lib/otto/security/authentication/auth_failure.rb', line 31

def user_context
  {}
end