Fixed domain identity issues

This commit is contained in:
Marcel Baumgartner
2023-07-24 00:30:18 +02:00
parent fedc9278d4
commit e2248a8444
2 changed files with 5 additions and 5 deletions

View File

@@ -90,6 +90,7 @@
<Folder Include="App\ApiClients\CloudPanel\Resources\" /> <Folder Include="App\ApiClients\CloudPanel\Resources\" />
<Folder Include="App\Http\Middleware" /> <Folder Include="App\Http\Middleware" />
<Folder Include="storage\backups\" /> <Folder Include="storage\backups\" />
<Folder Include="storage\plugins\" />
<Folder Include="storage\resources\public\background\" /> <Folder Include="storage\resources\public\background\" />
</ItemGroup> </ItemGroup>

View File

@@ -6,12 +6,14 @@
@using Moonlight.App.Services @using Moonlight.App.Services
@using CloudFlare.Client.Enumerators @using CloudFlare.Client.Enumerators
@using Moonlight.App.Services.Interop @using Moonlight.App.Services.Interop
@using Moonlight.App.Services.Sessions
@inject DomainRepository DomainRepository @inject DomainRepository DomainRepository
@inject DomainService DomainService @inject DomainService DomainService
@inject SmartTranslateService SmartTranslateService @inject SmartTranslateService SmartTranslateService
@inject NavigationManager NavigationManager @inject NavigationManager NavigationManager
@inject AlertService AlertService @inject AlertService AlertService
@inject IdentityService IdentityService
<LazyLoader Load="Load"> <LazyLoader Load="Load">
@if (Domain == null) @if (Domain == null)
@@ -181,9 +183,6 @@
[Parameter] [Parameter]
public int Id { get; set; } public int Id { get; set; }
[CascadingParameter]
public User? User { get; set; }
private Domain? Domain; private Domain? Domain;
private DnsRecord[] DnsRecords; private DnsRecord[] DnsRecords;
private DnsRecord NewRecord = new() private DnsRecord NewRecord = new()
@@ -205,13 +204,13 @@
if (Domain == null) if (Domain == null)
return; return;
if (User == null) if (IdentityService.User == null)
{ {
Domain = null; Domain = null;
return; return;
} }
if (Domain.Owner.Id != User.Id && !User.Admin) if (Domain.Owner.Id != IdentityService.User.Id && !IdentityService.User.Admin)
{ {
Domain = null; Domain = null;
return; return;