mirror of
https://github.com/lnbits/lnbits-legend.git
synced 2025-03-13 11:35:56 +01:00
streamalert fix request scheme
This commit is contained in:
parent
cfe7fc5e58
commit
ea99fcb203
2 changed files with 3 additions and 3 deletions
|
@ -14,7 +14,7 @@ from .models import CreateService, Donation, Service
|
|||
|
||||
async def get_service_redirect_uri(request, service_id):
|
||||
"""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"
|
||||
redirect_uri = uri_base + f"/authenticate/{service_id}"
|
||||
return redirect_uri
|
||||
|
|
|
@ -87,7 +87,7 @@ async def api_authenticate_service(service_id, request: Request, code: str = Que
|
|||
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}"
|
||||
url, success = await authenticate_service(service_id, code, redirect_uri)
|
||||
if success:
|
||||
|
@ -109,7 +109,7 @@ async def api_create_donation(data: CreateDonation, request: Request):
|
|||
# Fiat amount is calculated here while frontend is limited
|
||||
price = await btc_price(cur_code)
|
||||
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 = await get_service(service_id)
|
||||
charge_details = await get_charge_details(service.id)
|
||||
|
|
Loading…
Add table
Reference in a new issue