mirror of
https://github.com/lnbits/lnbits.git
synced 2025-10-03 18:04:36 +02:00
streamalert fix request scheme
This commit is contained in:
@@ -14,7 +14,7 @@ from .models import CreateService, Donation, Service
|
|||||||
|
|
||||||
async def get_service_redirect_uri(request, service_id):
|
async def get_service_redirect_uri(request, service_id):
|
||||||
"""Return the service's redirect URI, to be given to the third party API"""
|
"""Return the service's redirect URI, to be given to the third party API"""
|
||||||
uri_base = request.scheme + "://"
|
uri_base = request.url.scheme + "://"
|
||||||
uri_base += request.headers["Host"] + "/streamalerts/api/v1"
|
uri_base += request.headers["Host"] + "/streamalerts/api/v1"
|
||||||
redirect_uri = uri_base + f"/authenticate/{service_id}"
|
redirect_uri = uri_base + f"/authenticate/{service_id}"
|
||||||
return redirect_uri
|
return redirect_uri
|
||||||
|
@@ -87,7 +87,7 @@ async def api_authenticate_service(service_id, request: Request, code: str = Que
|
|||||||
detail="State doesn't match!"
|
detail="State doesn't match!"
|
||||||
)
|
)
|
||||||
|
|
||||||
redirect_uri = request.scheme + "://" + request.headers["Host"]
|
redirect_uri = request.url.scheme + "://" + request.headers["Host"]
|
||||||
redirect_uri += f"/streamalerts/api/v1/authenticate/{service_id}"
|
redirect_uri += f"/streamalerts/api/v1/authenticate/{service_id}"
|
||||||
url, success = await authenticate_service(service_id, code, redirect_uri)
|
url, success = await authenticate_service(service_id, code, redirect_uri)
|
||||||
if success:
|
if success:
|
||||||
@@ -109,7 +109,7 @@ async def api_create_donation(data: CreateDonation, request: Request):
|
|||||||
# Fiat amount is calculated here while frontend is limited
|
# Fiat amount is calculated here while frontend is limited
|
||||||
price = await btc_price(cur_code)
|
price = await btc_price(cur_code)
|
||||||
amount = sats * (10 ** (-8)) * price
|
amount = sats * (10 ** (-8)) * price
|
||||||
webhook_base = request.scheme + "://" + request.headers["Host"]
|
webhook_base = request.url.scheme + "://" + request.headers["Host"]
|
||||||
service_id = data.service
|
service_id = data.service
|
||||||
service = await get_service(service_id)
|
service = await get_service(service_id)
|
||||||
charge_details = await get_charge_details(service.id)
|
charge_details = await get_charge_details(service.id)
|
||||||
|
Reference in New Issue
Block a user