mirror of
https://github.com/btcpayserver/btcpayserver.git
synced 2025-01-18 13:26:47 +01:00
Make sure we do not expose lightning services if not admin
This commit is contained in:
parent
eec54831ef
commit
8530cf3535
@ -37,7 +37,8 @@ public class StoreLightningServices : ViewComponent
|
||||
if (vm.Store == null) throw new ArgumentNullException(nameof(vm.Store));
|
||||
if (vm.CryptoCode == null) throw new ArgumentNullException(nameof(vm.CryptoCode));
|
||||
if (vm.LightningNodeType != LightningNodeType.Internal) return View(vm);
|
||||
|
||||
if (!User.IsInRole(Roles.ServerAdmin)) return View(vm);
|
||||
|
||||
var services = _externalServiceOptions.Value.ExternalServices.ToList()
|
||||
.Where(service => ExternalServices.LightningServiceTypes.Contains(service.Type))
|
||||
.Select(async service =>
|
||||
@ -51,7 +52,7 @@ public class StoreLightningServices : ViewComponent
|
||||
};
|
||||
try
|
||||
{
|
||||
model.Link = await service.GetLink(Request.GetAbsoluteUriNoPathBase(), _btcpayServerOptions.NetworkType);
|
||||
model.Link = service.GetRedirectLink(Request.GetAbsoluteUriNoPathBase(), _btcpayServerOptions.NetworkType);
|
||||
}
|
||||
catch (Exception exception)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user