mirror of
https://github.com/aljazceru/btcpayserver.git
synced 2025-12-17 22:14:26 +01:00
Add sanity check in loading crowdfun
This commit is contained in:
@@ -115,10 +115,19 @@ namespace BTCPayServer.Controllers
|
|||||||
if (app == null)
|
if (app == null)
|
||||||
return NotFound();
|
return NotFound();
|
||||||
var settings = app.GetSettings<CrowdfundSettings>();
|
var settings = app.GetSettings<CrowdfundSettings>();
|
||||||
var isAdmin = false;
|
|
||||||
|
var hasEnoughSettingsToLoad = !string.IsNullOrEmpty(settings.TargetCurrency );
|
||||||
|
|
||||||
|
var isAdmin = await _AppsHelper.GetAppDataIfOwner(GetUserId(), appId, AppType.Crowdfund) != null;
|
||||||
|
if (!hasEnoughSettingsToLoad)
|
||||||
|
{
|
||||||
|
if(!isAdmin)
|
||||||
|
return NotFound();
|
||||||
|
|
||||||
|
return NotFound("A Target Currency must be set for this app in order to be loadable.");
|
||||||
|
}
|
||||||
if (!settings.Enabled)
|
if (!settings.Enabled)
|
||||||
{
|
{
|
||||||
isAdmin = await _AppsHelper.GetAppDataIfOwner(GetUserId(), appId, AppType.Crowdfund) != null;
|
|
||||||
if(!isAdmin)
|
if(!isAdmin)
|
||||||
return NotFound("Crowdfund is not currently active");
|
return NotFound("Crowdfund is not currently active");
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user