8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
# File 'app/controllers/spree/wing/base_controller.rb', line 8
def wing_http_authenticate!
wing_payment_method = Spree::PaymentMethod.find_by(type: Spree::PaymentMethod::TYPE_WINGSDK)
authenticate_or_request_with_http_basic do |username, password|
return false unless wing_payment_method.present?
if wing_payment_method.preferred_basic_auth_username.blank? ||
wing_payment_method.preferred_basic_auth_password.blank?
return false
end
username == wing_payment_method.preferred_basic_auth_username &&
password == wing_payment_method.preferred_basic_auth_password
end
end
|