Class: Devise::Strategies::WebmoneyAuthenticatable

Inherits:
Base
  • Object
show all
Defined in:
lib/devise_webmoney/strategy.rb

Instance Method Summary collapse

Instance Method Details

#authenticate!Object



12
13
14
15
16
17
18
19
20
# File 'lib/devise_webmoney/strategy.rb', line 12

def authenticate!
  logger.debug("Authenticating with Webmoney for mapping #{mapping.to}")

  if provider_response
    handle_response!
  else # Delegate authentication to Rack::Webmoney by throwing a 401
    custom! [401, { Rack::Webmoney::AUTHENTICATE_HEADER => Rack::Webmoney.build_header({}) }, "Sign in with Webmoney"]
  end
end

#valid?Boolean

Returns:

  • (Boolean)


8
9
10
# File 'lib/devise_webmoney/strategy.rb', line 8

def valid?
  valid_mapping? && ( provider_response? || params['auth_provider'] == 'webmoney' )
end