Fix lnurl for pull paymentdescription + fix authorize redirect form issue (#4630)

fixes #4627
fixes #4624
This commit is contained in:
Andrew Camilleri 2023-02-13 15:34:43 +01:00 committed by GitHub
parent dffa6accb0
commit 0d077f6ce5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 5 additions and 2 deletions

View file

@ -119,7 +119,7 @@ namespace BTCPayServer
LightMoneyUnit.BTC),
Tag = "withdrawRequest",
Callback = new Uri(Request.GetCurrentUrl()),
DefaultDescription = pp.GetBlob().Description ?? String.Empty,
DefaultDescription = pp.GetBlob().Name ?? String.Empty,
};
if (pr is null)
{

View file

@ -181,6 +181,7 @@ namespace BTCPayServer.Controllers
var permissions = key.GetBlob().Permissions;
var redirectVm = new PostRedirectViewModel()
{
AllowExternal = true,
FormUrl = viewModel.RedirectUrl.AbsoluteUri,
FormParameters =
{

View file

@ -7,6 +7,7 @@ namespace BTCPayServer.Models
public string AspAction { get; set; }
public string AspController { get; set; }
public string FormUrl { get; set; }
public bool AllowExternal { get; set; }
public MultiValueDictionary<string, string> FormParameters { get; set; } = new MultiValueDictionary<string, string>();
public Dictionary<string, string> RouteParameters { get; set; } = new Dictionary<string, string>();

View file

@ -38,7 +38,8 @@
}
else
{
<form method="post" id="postform" action="@Url.EnsureLocal(Model.FormUrl, this.Context.Request)" rel="noreferrer noopener">
var url = Model.AllowExternal ? Model.FormUrl : Url.EnsureLocal(Model.FormUrl, this.Context.Request);
<form method="post" id="postform" action="@url" rel="noreferrer noopener">
@Html.AntiForgeryToken()
@foreach (var o in Model.FormParameters)
{