Use the configured server URL for sensitive links (#7663)
What changed, and why it matters
This commit changes BTCPay Server so that sensitive links and QR codes use the administrator-configured server URL instead of whatever URL the current request happened to arrive on. Before the fix, if an attacker could get a victim to visit the server through a different domain or path, sensitive links (API key QR codes, login codes, Lightning node config downloads, monetization checkout links, multisig setup invitations, and pending wallet transaction links) could be generated pointing to that attacker-controlled or unexpected URL. The patch makes these features consistently use the canonical server URL configured by the admin, reducing the risk of phishing, session/token leakage, or misdirected actions.
Treat this as a security hardening fix and include it in the next release. Review any other locations that still use Request.GetRequestBaseUrl()/GetAbsoluteRoot() for security-sensitive links to ensure they also use the configured canonical URL. Consider documenting the canonical server URL setting as a security-relevant configuration.
Security signals we found
Sensitive links/QR codes previously derived canonical URL from incoming HTTP request
Patch centralizes canonical URL via CallbackGenerator.GetRequestBaseUrl()
Affected flows include authentication (login codes), authorization (API keys), wallet operations (multisig, pending transactions), and service configuration (LND config)
New test explicitly asserts canonical URL is used across multiple features
Removal of AdminLoginSetsBaseUrlWhenMissing test shows behavior change: request path no longer overrides configured base URL
Evidence from the diff
The patch replaces ad-hoc use of Request.GetRequestBaseUrl()/Request.GetAbsoluteRoot() and Url.ActionAbsolute(Request, …) with a centralized CallbackGenerator.GetRequestBaseUrl() helper for several security-sensitive flows. Affected flows: API key QR host value, login-code QR generation, LND config QR download link, monetization plan checkout redirect and stored BaseUrl, multisig signer request emails and stored RequestBaseUrl, and pending transaction creation/stored RequestBaseUrl. A new integration test (ConfiguredServerUrlTests) verifies that all these generated links use the configured canonical URL. The change also removes an older test that expected admin login to overwrite the configured base URL with the current request’s path, indicating a deliberate shift away from deriving trust from the incoming request.
Changed components
BTCPayServer/Controllers/UIServerController.cs (LND config QR)BTCPayServer/Plugins/Impersonation/UserLoginCode.razor and LoginCodes.cshtml (login code QR)BTCPayServer/Plugins/Monetization/Controllers/UIUserMonetizationController.cs (plan checkout links)BTCPayServer/Plugins/Wallets/Controllers/UIWalletsController.cs and UIWalletsController.PSBT.cs (pending transactions)BTCPayServer/Views/UIManage/APIKeys.cshtml (API key QR host)BTCPayServer.Tests/ConfiguredServerUrlTests.cs (new regression test)Inspect captured patch +180 / −66
### BTCPayServer.Tests/ApiKeysTests.cs
@@ -90,7 +90,6 @@ async Task AssertPermission(string permission)
//this api key has access to everything
await TestApiAgainstAccessToken(superApiKey, tester, user, Policies.CanModifyServerSettings, Policies.CanModifyStoreSettings,
Policies.CanViewProfile);
-
await s.ClickPagePrimary();
await s.Page.SetCheckedAsync("#btcpay\\.server\\.canmodifyserversettings", true);
await s.ClickPagePrimary();
### BTCPayServer.Tests/ConfiguredServerUrlTests.cs
@@ -0,0 +1,159 @@
+using System;
+using System.Text.RegularExpressions;
+using System.Threading.Tasks;
+using BTCPayServer.Abstractions;
+using BTCPayServer.Configuration;
+using BTCPayServer.Controllers;
+using BTCPayServer.Data;
+using BTCPayServer.Events;
+using BTCPayServer.HostedServices;
+using BTCPayServer.Models.AccountViewModels;
+using BTCPayServer.Plugins.Multisig.Services;
+using BTCPayServer.Services;
+using BTCPayServer.Views.Manage;
+using BTCPayServer.Views.Wallets;
+using Microsoft.Extensions.Options;
+using Microsoft.Playwright;
+using NBitcoin;
+using Newtonsoft.Json.Linq;
+using Xunit;
+using static Microsoft.Playwright.Assertions;
+
+namespace BTCPayServer.Tests;
+
+[Collection(nameof(NonParallelizableCollectionDefinition))]
+public class ConfiguredServerUrlTests(ITestOutputHelper helper) : UnitTestBase(helper)
+{
+ private const string ConfiguredUrl = "https://canonical.example/btcpay";
+
+ [Fact]
+ [Trait("Playwright", "Playwright")]
+ public async Task UsesConfiguredServerUrlForGeneratedLinks()
+ {
+ const string password = "Kitten0@";
+ await using var s = CreatePlaywrightTester(newDb: true);
+ await s.StartAsync();
+ var owner = Utils.GenerateEmail();
+ var accountController = s.Server.PayTester.GetController<UIAccountController>();
+ accountController.Request.PathBase = "/btcpay";
+ await accountController.Register(new RegisterViewModel
+ {
+ Email = owner,
+ Password = password,
+ ConfirmPassword = password
+ });
+
+ var settingsRepository = s.Server.PayTester.GetService<SettingsRepository>();
+ var serverSettings = await settingsRepository.GetSettingAsync<ServerSettings>();
+ Assert.Equal($"http://127.0.0.1:{s.Server.PayTester.Port}/btcpay", serverSettings?.BaseUrl);
+ await s.GoToLogin();
+ await s.LogIn(owner, password);
+
+ var (_, storeId) = await s.CreateNewStore();
+ await s.GoToServer("MonetizationPlugin");
+ await s.ClickPagePrimary();
+ await s.ConfirmModal();
+ await s.FindAlertMessage(partialText: "Monetization activated");
+
+ serverSettings = await settingsRepository.GetSettingAsync<ServerSettings>() ?? new ServerSettings();
+ serverSettings.UpdateBaseUrl(RequestBaseUrl.FromUrl(ConfiguredUrl));
+ await settingsRepository.UpdateSetting(serverSettings);
+ await s.Logout();
+ await s.GoToLogin();
+ await s.LogIn(owner, password);
+ Assert.Equal(ConfiguredUrl, (await settingsRepository.GetSettingAsync<ServerSettings>())?.BaseUrl);
+
+ await s.GoToProfile(ManageNavPages.APIKeys);
+ await s.ClickPagePrimary();
+ await s.ClickPagePrimary();
+ var apiKey = await (await s.FindAlertMessage()).Locator("code").TextContentAsync();
+ var apiKeyRow = s.Page.Locator("tr").Filter(new() { HasText = apiKey });
+ await apiKeyRow.Locator("button[data-qr]").ClickAsync();
+ var qrData = await s.Page.Locator(".truncate-center.form-control-plaintext").GetAttributeAsync("data-text");
+ var apiKeyPayload = JObject.Parse(qrData!);
+ Assert.Equal(apiKey, apiKeyPayload.Value<string>("apiKey"));
+ Assert.Equal(ConfiguredUrl, apiKeyPayload.Value<string>("host"));
+ await s.Page.GetByRole(AriaRole.Dialog).GetByRole(AriaRole.Button, new() { Name = "Close" }).ClickAsync();
+
+ await s.GoToProfile(ManageNavPages.LoginCodes);
+ var loginCodeUrl = await s.Page.Locator("#LoginCode .qr-code").GetAttributeAsync("alt");
+ Assert.StartsWith($"{ConfiguredUrl}/login?", loginCodeUrl);
+
+ var externalServices = s.Server.PayTester.GetService<IOptions<ExternalServicesOptions>>().Value.ExternalServices;
+ externalServices.Add(new ExternalService
+ {
+ Type = ExternalServiceTypes.LNDRest,
+ ServiceName = "lndrest",
+ DisplayName = "LND (REST)",
+ CryptoCode = "BTC",
+ ConnectionString = new ExternalConnectionString(new Uri("https://127.0.0.1:8080"))
+ {
+ Macaroon = [1, 2, 3]
+ }
+ });
+ await s.GoToUrl("/server/services/lndrest/BTC");
+ await s.Page.GetByRole(AriaRole.Button, new() { Name = "Show QR Code" }).ClickAsync();
+ var lndConfig = await s.Page.Locator("#qrCodeData").GetAttributeAsync("data-url");
+ Assert.Matches($"^config={Regex.Escape(ConfiguredUrl)}/lnd-config/[0-9]+/lnd\\.config$", lndConfig!);
+
+ await using (await s.SwitchPage())
+ {
+ var registered = await s.Server.WaitForEvent<UserEvent.Registered>(async () =>
+ {
+ await s.GoToUrl("/monetization/new-user");
+ var planCheckoutUrl = await s.Page.Locator(".plan-checkout__qr-modal .qr-code").GetAttributeAsync("alt");
+ Assert.StartsWith($"{ConfiguredUrl}/plan-checkout/", planCheckoutUrl);
+ await s.Page.FillAsync(".plan-checkout__email", "canonical-user@example.com");
+ await s.ClickPagePrimary();
+ }, evt => evt.User.Email == "canonical-user@example.com");
+ Assert.Equal(ConfiguredUrl, registered.RequestBaseUrl.ToString());
+ Assert.StartsWith($"{ConfiguredUrl}/register/confirm-email?", registered.ConfirmationEmailLink);
+ }
+
+ await s.ConfigureServerEmailWithMailPit(
+ from: "canonical-url@test.com",
+ login: "canonical-url@test.com",
+ password: "canonical-url@test.com");
+ await s.GoToUrl($"/stores/{storeId}/onchain/BTC/import/multisig");
+ await s.Page.Locator($"label.multisig-signer-item:has-text('{owner}') input[type='checkbox']").CheckAsync();
+ await s.Page.FillAsync("#MultisigRequiredSigners", "1");
+ await s.Page.FillAsync("#MultisigTotalSigners", "1");
+ await s.Page.SelectOptionAsync("#MultisigScriptType", "p2wsh");
+ var signerRequestEmail = await s.Server.AssertHasEmail(() => s.Page.ClickAsync("#CreateSignerRequest"));
+ var multisigService = s.Server.PayTester.GetService<MultisigService>();
+ var setup = Assert.Single(await multisigService.GetPendingMultisigSetup(storeId));
+ Assert.Equal(ConfiguredUrl, setup.RequestBaseUrl.ToString());
+ Assert.Contains($"{ConfiguredUrl}/multisig-setups/{setup.RequestId}",
+ signerRequestEmail.Html ?? signerRequestEmail.Text ?? string.Empty,
+ StringComparison.OrdinalIgnoreCase);
+
+ var rootKey = new Mnemonic("all all all all all all all all all all all all").DeriveExtKey();
+ var accountKeyPath = KeyPath.Parse("48'/1'/0'/2'");
+ var accountKey = rootKey.Derive(accountKeyPath).Neuter().ToString(Network.RegTest);
+ var rootedAccountKeyPath = new RootedKeyPath(rootKey.GetPublicKey().GetHDFingerPrint(), accountKeyPath);
+ await s.Page.ClickAsync("#SubmitSignerKeyCta");
+ await s.Page.ClickAsync("#SubmitSignerKeyManual");
+ await s.Page.FillAsync("#DisplayAccountKey", accountKey);
+ await s.Page.FillAsync("#AccountKeyPath", rootedAccountKeyPath.ToString());
+ await s.Server.AssertHasEmail(() => s.Page.ClickAsync("button[type='submit']"));
+ await Expect(s.Page.Locator("#FinalizeMultisig")).ToBeVisibleAsync();
+ await s.Page.ClickAsync("#FinalizeMultisig");
+ await Expect(s.Page.Locator("#Confirm")).ToBeVisibleAsync();
+ await s.Server.AssertHasEmail(() => s.Page.ClickAsync("#Confirm"));
+
+ await s.GoToWallet(navPages: WalletsNavPages.Receive);
+ var addressElement = s.Page.Locator("#Address");
+ await addressElement.ClickAsync();
+ var address = await addressElement.GetAttributeAsync("data-text");
+ Assert.NotNull(address);
+ await s.Page.ClickAsync("button[value='fill-wallet']");
+ await s.Page.ClickAsync("#CancelWizard");
+ await s.GoToWallet(navPages: WalletsNavPages.Send);
+ await s.Page.FillAsync("#Outputs_0__DestinationAddress", address);
+ await s.Page.FillAsync("#Outputs_0__Amount", "0.1");
+ await s.Page.ClickAsync("#CreatePendingTransaction");
+ var pendingTransactionService = s.Server.PayTester.GetService<PendingTransactionService>();
+ var pending = Assert.Single(await pendingTransactionService.GetPendingTransactions("BTC", storeId));
+ Assert.Equal(ConfiguredUrl, pending.GetBlob().RequestBaseUrl);
+ }
+}
### BTCPayServer.Tests/MonetizationTests.cs
@@ -1,6 +1,5 @@
#nullable enable
using System.Threading.Tasks;
-using BTCPayServer.Abstractions;
using BTCPayServer.Abstractions.Models;
using BTCPayServer.Data;
using BTCPayServer.Events;
@@ -31,19 +30,12 @@ public async Task DoesNotAttachNewSubscriberToExistingUser()
await s.ConfirmModal();
await s.FindAlertMessage(partialText: "Monetization activated");
- var settingsRepository = s.Server.PayTester.GetService<SettingsRepository>();
- var serverSettings = await settingsRepository.GetSettingAsync<ServerSettings>() ?? new ServerSettings();
- serverSettings.UpdateBaseUrl(RequestBaseUrl.FromUrl("https://canonical.example/btcpay"));
- await settingsRepository.UpdateSetting(serverSettings);
-
SubscriptionEvent.NewSubscriber newSubscriber;
await using (await s.SwitchPage())
{
newSubscriber = await s.Server.WaitForEvent<SubscriptionEvent.NewSubscriber>(async () =>
{
await s.GoToUrl("/monetization/new-user");
- var qrUrl = await s.Page.Locator(".plan-checkout__qr-modal .qr-code").GetAttributeAsync("alt");
- Assert.StartsWith("https://canonical.example/btcpay/plan-checkout/", qrUrl);
await s.Page.FillAsync(".plan-checkout__email", "existing-user@gmail.com");
await s.ClickPagePrimary();
});
### BTCPayServer.Tests/MultisigTests.cs
@@ -574,11 +574,6 @@ public async Task CanUseMultisigSetup()
var userManager = scope.ServiceProvider.GetRequiredService<UserManager<ApplicationUser>>();
var storeRepo = scope.ServiceProvider.GetRequiredService<StoreRepository>();
var multisigService = scope.ServiceProvider.GetRequiredService<MultisigService>();
- var settingsRepository = scope.ServiceProvider.GetRequiredService<SettingsRepository>();
- var serverSettings = await settingsRepository.GetSettingAsync<ServerSettings>() ?? new ServerSettings();
- serverSettings.UpdateBaseUrl(RequestBaseUrl.FromUrl("https://canonical.example/btcpay"));
- await settingsRepository.UpdateSetting(serverSettings);
-
var signerAUser = await userManager.FindByEmailAsync(signerA);
var signerBUser = await userManager.FindByEmailAsync(signerB);
var walletManagerUser = await userManager.FindByEmailAsync(walletManager);
@@ -617,12 +612,11 @@ async Task<string> CreateRequest(params string[] participantEmails)
Assert.Equal("Multisig signer request for BTC", signerRequestEmail.Subject);
var currentPending = (await multisigService.GetPendingMultisigSetup(storeId))[0];
Assert.NotNull(currentPending);
- Assert.Equal("https://canonical.example/btcpay", currentPending.RequestBaseUrl.ToString());
Assert.Equal(storeId, currentPending.StoreId);
Assert.Equal("BTC", currentPending.CryptoCode);
Assert.Equal(2, currentPending.Participants.Count);
Assert.All(currentPending.Participants, p => Assert.True(string.IsNullOrEmpty(p.AccountKey)));
- Assert.Contains($"https://canonical.example/btcpay/multisig-setups/{currentPending.RequestId}", signerRequestEmail.Html ?? signerRequestEmail.Text ?? string.Empty, StringComparison.OrdinalIgnoreCase);
+ Assert.Contains($"/multisig-setups/{currentPending.RequestId}", signerRequestEmail.Html ?? signerRequestEmail.Text ?? string.Empty, StringComparison.OrdinalIgnoreCase);
Assert.EndsWith($"/multisig-setups/{currentPending.RequestId}", new Uri(s.Page.Url).AbsolutePath);
await Expect(s.Page.Locator("#MultisigRequiredSigners")).ToHaveCountAsync(0);
await Expect(s.Page.Locator("#MultisigTotalSigners")).ToHaveCountAsync(0);
### BTCPayServer.Tests/UnitTest1.cs
@@ -1976,42 +1976,6 @@ public async Task CheckLogsRoute()
Assert.IsType<LogsViewModel>(Assert.IsType<ViewResult>(await serverController.LogsView()).Model);
}
- [Fact(Timeout = LongRunningTestTimeout)]
- [Trait("Integration", "Integration")]
- public async Task AdminLoginSetsBaseUrlWhenMissing()
- {
- using var tester = CreateServerTester(newDb: true);
- await tester.StartAsync();
-
- var account = tester.PayTester.GetController<UIAccountController>();
- account.Request.PathBase = "/btcpay";
- var registration = new RegisterViewModel
- {
- Email = Utils.GenerateEmail(),
- Password = "Kitten0@",
- ConfirmPassword = "Kitten0@"
- };
- await account.Register(registration);
-
- var settingsRepository = tester.PayTester.GetService<SettingsRepository>();
- var serverSettings = await settingsRepository.GetSettingAsync<ServerSettings>();
- Assert.Equal($"http://127.0.0.1:{tester.PayTester.Port}/btcpay", serverSettings?.BaseUrl);
-
- serverSettings.BaseUrl = "https://configured.example";
- await settingsRepository.UpdateSetting(serverSettings);
- account = tester.PayTester.GetController<UIAccountController>();
- account.Request.PathBase = "/different-root";
- await account.Login(new LoginViewModel
- {
- Email = registration.Email,
- Password = registration.Password,
- Method = "Password"
- });
-
- serverSettings = await settingsRepository.GetSettingAsync<ServerSettings>();
- Assert.Equal("https://configured.example", serverSettings?.BaseUrl);
- }
-
[Fact(Timeout = LongRunningTestTimeout)]
[Trait("Playwright", "Playwright")]
public async Task CanLoginWithNoSecondaryAuthSystemsOrRequestItWhenAdded()
### BTCPayServer/Controllers/UIServerController.cs
@@ -566,7 +566,11 @@ routes.EnabledRoutes is { } enabledRoutes
var lnConfig = _LnConfigProvider.GetConfig(configKey);
if (lnConfig != null)
{
- model.QRCodeLink = Url.ActionAbsolute(Request, nameof(GetLNDConfig), new { configKey }).ToString();
+ model.QRCodeLink = _callbackGenerator.LinkGenerator.GetUriByAction(
+ nameof(GetLNDConfig),
+ "UIServer",
+ new { configKey },
+ _callbackGenerator.GetRequestBaseUrl());
model.QRCode = $"config={model.QRCodeLink}";
}
}
### BTCPayServer/Plugins/Impersonation/UserLoginCode.razor
@@ -1,12 +1,11 @@
@using System.Timers
-@using BTCPayServer.Abstractions.Extensions
+@using BTCPayServer.Abstractions
@using BTCPayServer.Blazor
@using BTCPayServer.Client
@using BTCPayServer.Data
@using BTCPayServer.Security
@using Microsoft.AspNetCore.Authorization
@using Microsoft.AspNetCore.Components.Authorization
-@using Microsoft.AspNetCore.Http
@using Microsoft.AspNetCore.Identity
@using Microsoft.AspNetCore.Mvc
@using Microsoft.AspNetCore.Routing
@@ -16,7 +15,6 @@
@inject UserManager<ApplicationUser> UserManager
@inject UserLoginCodeService UserLoginCodeService
@inject LinkGenerator LinkGenerator
-@inject IHttpContextAccessor HttpContextAccessor
@inject IStringLocalizer StringLocalizer
@implements IDisposable
@@ -36,6 +34,8 @@
@code {
[Parameter]
public string RedirectUrl { get; set; }
+ [Parameter]
+ public string BaseUrl { get; set; }
[Parameter]
public int Size { get; set; } = 256;
@@ -93,9 +93,7 @@
private string GetData(string loginCode)
{
- var req = HttpContextAccessor.HttpContext?.Request;
- if (req == null) return "";
- return LinkGenerator.LoginCodeLink(loginCode, RedirectUrl, req.GetRequestBaseUrl());
+ return LinkGenerator.LoginCodeLink(loginCode, RedirectUrl, RequestBaseUrl.FromUrl(BaseUrl));
}
private double Percent => Math.Round(_seconds / Seconds * 100);
### BTCPayServer/Plugins/Impersonation/Views/LoginCodes.cshtml
@@ -1,5 +1,6 @@
@using BTCPayServer.Plugins.Impersonation
@using BTCPayServer.Views.Manage
+@inject BTCPayServer.Services.CallbackGenerator CallbackGenerator
@{
ViewData.SetLayoutModel(new LayoutModel(nameof(ManageNavPages.LoginCodes), StringLocalizer["Login Codes"])
.SetCategory(nameof(ManageNavPages)));
@@ -12,4 +13,4 @@
</div>
<partial name="_StatusMessage" />
<p text-translate="true">Easily log into BTCPay Server on another device using a simple login code from an already authenticated device.</p>
-<component type="typeof(UserLoginCode)" render-mode="ServerPrerendered" param-id="@("LoginCode")"/>
+<component type="typeof(UserLoginCode)" render-mode="ServerPrerendered" param-id="@("LoginCode")" param-BaseUrl="@CallbackGenerator.GetRequestBaseUrl().ToString()"/>
### BTCPayServer/Plugins/Monetization/Controllers/UIUserMonetizationController.cs
@@ -23,6 +23,7 @@ public class UIUserMonetizationController(
MonetizationSettings settings,
PoliciesSettings policies,
LinkGenerator linkGenerator,
+ CallbackGenerator callbackGenerator,
IStringLocalizer stringLocalizer
) : Controller
{
@@ -45,11 +46,11 @@ public async Task<IActionResult> NewUser()
Plan = plan,
NewSubscriber = true,
IsTrial = plan.TrialDays > 0,
- BaseUrl = Request.GetRequestBaseUrl()
+ BaseUrl = callbackGenerator.GetRequestBaseUrl()
};
ctx.PlanCheckouts.Add(checkout);
await ctx.SaveChangesAsync();
- return Redirect(linkGenerator.PlanCheckout(checkout.Id, checkout.BaseUrl));
+ return Redirect(linkGenerator.PlanCheckout(checkout.Id, Request.GetRequestBaseUrl()));
}
[HttpGet("~/account/billing")]
### BTCPayServer/Plugins/Wallets/Controllers/UIWalletsController.PSBT.cs
@@ -182,7 +182,7 @@ public async Task<IActionResult> WalletPSBT(
switch (command)
{
case "createpending":
- await pendingTransactionService.CreatePendingTransaction(walletId.StoreId, walletId.CryptoCode, psbt, Request.GetRequestBaseUrl());
+ await pendingTransactionService.CreatePendingTransaction(walletId.StoreId, walletId.CryptoCode, psbt, callbackGenerator.GetRequestBaseUrl());
return RedirectToAction(nameof(WalletTransactions), new { walletId = walletId.ToString() });
case "sign":
return await WalletSign(walletId, vm);
### BTCPayServer/Plugins/Wallets/Controllers/UIWalletsController.cs
@@ -86,6 +86,7 @@ public partial class UIWalletsController(
TransactionLinkProviders transactionLinkProviders,
InvoiceRepository invoiceRepository,
DisplayFormatter displayFormatter,
+ CallbackGenerator callbackGenerator,
HotwalletSafe hotwalletSafe)
: Controller
{
@@ -418,7 +419,7 @@ await this.WalletRepository.EnsureWalletObject(new WalletObjectId(walletId, Wall
switch (model.Command)
{
case "createpending":
- await pendingTransactionService.CreatePendingTransaction(walletId.StoreId, walletId.CryptoCode, psbt, Request.GetRequestBaseUrl());
+ await pendingTransactionService.CreatePendingTransaction(walletId.StoreId, walletId.CryptoCode, psbt, callbackGenerator.GetRequestBaseUrl());
return RedirectToWalletList(walletId);
case "sign":
if (!(await authorizationService.AuthorizeAsync(User, walletId.StoreId, WalletPolicies.CanSignWalletTransactions)).Succeeded)
@@ -1502,7 +1503,7 @@ public async Task<IActionResult> WalletSend(
switch (command)
{
case "createpending":
- await pendingTransactionService.CreatePendingTransaction(walletId.StoreId, walletId.CryptoCode, psbt, Request.GetRequestBaseUrl());
+ await pendingTransactionService.CreatePendingTransaction(walletId.StoreId, walletId.CryptoCode, psbt, callbackGenerator.GetRequestBaseUrl());
return RedirectToAction(nameof(WalletTransactions), new { walletId = walletId.ToString() });
case "sign":
return await WalletSign(walletId, new WalletPSBTViewModel
### BTCPayServer/Views/UIManage/APIKeys.cshtml
@@ -1,6 +1,7 @@
@namespace BTCPayServer.Client
@using Microsoft.AspNetCore.Html
@inject Security.ContentSecurityPolicies Csp
+@inject BTCPayServer.Services.CallbackGenerator CallbackGenerator
@model BTCPayServer.Controllers.UIManageController.ApiKeysViewModel
@{
ViewData.SetLayoutModel(new LayoutModel(nameof(ManageNavPages.APIKeys), StringLocalizer["API Keys"])
@@ -128,7 +129,7 @@
const apiKeys = @Safe.Json(Model.ApiKeyDatas.Select(data => new
{
ApiKey = data.Key,
- Host = Context.Request.GetAbsoluteRoot()
+ Host = CallbackGenerator.GetRequestBaseUrl().ToString()
}));
const qrApp = initQRShow({ title: "API Key QR" });
delegate("click", "button[data-qr]", e => {Why this scored 59/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.