Class: Devise::Strategies::Authenticatable

Inherits:
Base
  • Object
show all
Defined in:
lib/devise/strategies/authenticatable.rb

Overview

This strategy should be used as basis for authentication strategies. It retrieves parameters both from params or from http authorization headers. See database_authenticatable for an example.

Direct Known Subclasses

DatabaseAuthenticatable, Rememberable

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#authentication_hashObject

Returns the value of attribute authentication_hash.



9
10
11
# File 'lib/devise/strategies/authenticatable.rb', line 9

def authentication_hash
  @authentication_hash
end

#authentication_typeObject

Returns the value of attribute authentication_type.



9
10
11
# File 'lib/devise/strategies/authenticatable.rb', line 9

def authentication_type
  @authentication_type
end

#passwordObject

Returns the value of attribute password.



9
10
11
# File 'lib/devise/strategies/authenticatable.rb', line 9

def password
  @password
end

Instance Method Details

#clean_up_csrf?Boolean

Override and set to false for things like OmniAuth that technically run through Authentication (user_set) very often, which would normally reset CSRF data in the session

Returns:

  • (Boolean)


22
23
24
# File 'lib/devise/strategies/authenticatable.rb', line 22

def clean_up_csrf?
  true
end

#store?Boolean

Returns:

  • (Boolean)


11
12
13
# File 'lib/devise/strategies/authenticatable.rb', line 11

def store?
  super && !mapping.to.skip_session_storage.include?(authentication_type)
end

#valid?Boolean

Returns:

  • (Boolean)


15
16
17
# File 'lib/devise/strategies/authenticatable.rb', line 15

def valid?
  valid_for_params_auth? || valid_for_http_auth?
end