diff --git a/app/controllers/lnurlpay_controller.rb b/app/controllers/lnurlpay_controller.rb index 5763262..79661d9 100644 --- a/app/controllers/lnurlpay_controller.rb +++ b/app/controllers/lnurlpay_controller.rb @@ -1,6 +1,7 @@ class LnurlpayController < ApplicationController before_action :check_service_available before_action :find_user + before_action :set_cors_access_control_headers, only: [:invoice] MIN_SATS = 10 MAX_SATS = 1_000_000 @@ -61,6 +62,12 @@ class LnurlpayController < ApplicationController private + def set_cors_access_control_headers + headers['Access-Control-Allow-Origin'] = "*" + headers['Access-Control-Allow-Headers'] = "*" + headers['Access-Control-Allow-Methods'] = "GET" + end + def check_service_available http_status :not_found unless Setting.lndhub_enabled? end