mirror of
https://github.com/btcpayserver/btcpayserver.git
synced 2025-02-21 22:11:48 +01:00
Fix app permissions (#3227)
* Fix app permissions As pointed out by @nicolasdorier [here](https://github.com/btcpayserver/btcpayserver/pull/3205#issuecomment-999437555). * Fix for login codes view * Ensure app belongs to store
This commit is contained in:
parent
48ac996d77
commit
4a66c91cac
2 changed files with 10 additions and 3 deletions
|
@ -66,8 +66,15 @@ namespace BTCPayServer.Security
|
||||||
if (routeData.Values.TryGetValue("appId", out var vAppId))
|
if (routeData.Values.TryGetValue("appId", out var vAppId))
|
||||||
{
|
{
|
||||||
string appId = vAppId as string;
|
string appId = vAppId as string;
|
||||||
app = await _appService.GetApp(appId, null);
|
app = await _appService.GetAppDataIfOwner(userId, appId);
|
||||||
storeId ??= app?.StoreDataId;
|
if (storeId == null)
|
||||||
|
{
|
||||||
|
storeId = app?.StoreDataId;
|
||||||
|
}
|
||||||
|
else if (app?.StoreDataId != storeId)
|
||||||
|
{
|
||||||
|
app = null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
// resolve from payment request
|
// resolve from payment request
|
||||||
if (routeData.Values.TryGetValue("payReqId", out var vPayReqId))
|
if (routeData.Values.TryGetValue("payReqId", out var vPayReqId))
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
@model string
|
@model string
|
||||||
@{
|
@{
|
||||||
ViewData.SetActivePageAndTitle(ManageNavPages.LoginCodes, "Login codes");
|
ViewData.SetActivePage(ManageNavPages.LoginCodes, "Login codes");
|
||||||
}
|
}
|
||||||
<h2 class="mb-4">@ViewData["Title"]</h2>
|
<h2 class="mb-4">@ViewData["Title"]</h2>
|
||||||
<p>Easily log into BTCPay Server on another device using a simple login code from an already authenticated device.</p>
|
<p>Easily log into BTCPay Server on another device using a simple login code from an already authenticated device.</p>
|
||||||
|
|
Loading…
Add table
Reference in a new issue