Moved several appsettings defaults to user-secrets

This commit is contained in:
2021-10-14 00:07:00 -04:00
parent c8d45a01c9
commit 9a59f46f90
9 changed files with 22 additions and 26 deletions

View File

@@ -2,14 +2,7 @@
@using Microsoft.AspNetCore.Http @using Microsoft.AspNetCore.Http
@using Microsoft.AspNetCore.Authentication @using Microsoft.AspNetCore.Authentication
@inject IHttpContextAccessor _httpContextAccessor @inject IHttpContextAccessor _httpContextAccessor
<AuthorizeView> @attribute [Authorize]
<Authorized>
</Authorized>
<NotAuthorized>
<h1>You must be logged in to view this page!</h1>
</NotAuthorized>
</AuthorizeView>
@code { @code {
protected async override Task OnInitializedAsync() protected async override Task OnInitializedAsync()

View File

@@ -12,16 +12,15 @@
<span class="oi oi-home" aria-hidden="true"></span> Home <span class="oi oi-home" aria-hidden="true"></span> Home
</NavLink> </NavLink>
</li> </li>
<AuthorizeView>
<Authorized>
<li class="nav-item px-3"> <li class="nav-item px-3">
<NavLink class="nav-link" href="counter"> <NavLink class="nav-link" href="createserver">
<span class="oi oi-plus" aria-hidden="true"></span> Counter <span class="oi oi-list-rich" aria-hidden="true"></span> Create Server
</NavLink>
</li>
<li class="nav-item px-3">
<NavLink class="nav-link" href="fetchdata">
<span class="oi oi-list-rich" aria-hidden="true"></span> Fetch data
</NavLink> </NavLink>
</li> </li>
</Authorized>
</AuthorizeView>
</ul> </ul>
</div> </div>

View File

@@ -8,7 +8,7 @@
}, },
"AllowedHosts": "*", "AllowedHosts": "*",
"oidc" : { "oidc" : {
"authority" : "https://dummy.dummy", "authority" : "oidc_url",
"client_id": "id", "client_id": "id",
"client_secret": "secret" "client_secret": "secret"
} }

View File

@@ -3,6 +3,6 @@ namespace WebAPI.Data.Models
public class User : BaseEntity public class User : BaseEntity
{ {
public int? PterodactylUserId { get; set; } public int? PterodactylUserId { get; set; }
public int? ExternalAuthIdentifier { get; set; } public string ExternalAuthIdentifier { get; set; }
} }
} }

View File

@@ -32,7 +32,7 @@ namespace WebAPI.Data
{ {
return false; return false;
} }
return false; return true;
} }
} }

View File

@@ -18,6 +18,9 @@ namespace WebAPI
public static IHostBuilder CreateHostBuilder(string[] args) => public static IHostBuilder CreateHostBuilder(string[] args) =>
Host.CreateDefaultBuilder(args) Host.CreateDefaultBuilder(args)
.ConfigureWebHostDefaults(webBuilder => { webBuilder.UseStartup<Startup>(); }); .ConfigureWebHostDefaults(webBuilder =>
{
webBuilder.UseStartup<Startup>();
});
} }
} }

View File

@@ -22,7 +22,7 @@
"dotnetRunMessages": "true", "dotnetRunMessages": "true",
"launchBrowser": true, "launchBrowser": true,
"launchUrl": "swagger", "launchUrl": "swagger",
"applicationUrl": "https://localhost:5001;http://localhost:5000", "applicationUrl": "https://localhost:44319;http://localhost:36546",
"environmentVariables": { "environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development" "ASPNETCORE_ENVIRONMENT": "Development"
} }

View File

@@ -1,7 +1,8 @@
<Project Sdk="Microsoft.NET.Sdk.Web"> <Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup> <PropertyGroup>
<TargetFramework>net5.0</TargetFramework> <TargetFramework>net5.0</TargetFramework>
<UserSecretsId>70ad8aec-0a1b-4ec9-bd5c-3d11ff1fcd93</UserSecretsId>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>

View File

@@ -12,5 +12,5 @@
"AllowedHosts": "*", "AllowedHosts": "*",
"PterodactylAPIKey": "REPLACE_ME", "PterodactylAPIKey": "REPLACE_ME",
"PterodactylPanelURL": "https://panel.orfl.xyz", "PterodactylPanelURL": "https://panel.orfl.xyz",
"OIDCUserInfoEndpoint": "https://authentik.mattstop.com/application/o/userinfo" "OIDCUserInfoEndpoint": "https://authentik.mattstop.com/application/o/userinfo/"
} }