Class: MagicLinks::Strategies::MagicTokenAuthentication

Inherits:
Devise::Strategies::Base
  • Object
show all
Defined in:
lib/magic_links/strategies/magic_token_authentication.rb

Instance Method Summary collapse

Instance Method Details

#authenticate!Object



9
10
11
12
13
14
15
# File 'lib/magic_links/strategies/magic_token_authentication.rb', line 9

def authenticate!
  return unless magic_token.present? && magic_token.valid?
  return unless valid_devise_mapping?
  return unless permitted_action?

  success!(resource)
end

#clean_up_csrf?Boolean

Returns:

  • (Boolean)


21
22
23
# File 'lib/magic_links/strategies/magic_token_authentication.rb', line 21

def clean_up_csrf?
  false
end

#store?Boolean

Returns:

  • (Boolean)


17
18
19
# File 'lib/magic_links/strategies/magic_token_authentication.rb', line 17

def store?
  false
end

#valid?Boolean

Returns:

  • (Boolean)


5
6
7
# File 'lib/magic_links/strategies/magic_token_authentication.rb', line 5

def valid?
  magic_token_cookie.present?
end