Ensure Install Wizard will only be displayed if the Master database connection string in appsettings.json is not specified. This addresses a potential security issue where the Install Wizard could be displayed in an existing installation if the Master database connection failed during startup.

This commit is contained in:
Shaun Walker
2021-03-30 17:48:49 -04:00
parent 5cd1d3a7af
commit 09c040128a
8 changed files with 63 additions and 32 deletions

View File

@ -1,31 +1,39 @@
@inject IInstallationService InstallationService
@inject IInstallationService InstallationService
@if (_initialized)
{
@if (!_installed)
@if (!_installation.Success)
{
<Installer />
}
else
{
<CascadingAuthenticationState>
<CascadingValue Value="@PageState">
<SiteRouter OnStateChange="@ChangeState" />
</CascadingValue>
</CascadingAuthenticationState>
@if (string.IsNullOrEmpty(_installation.Message))
{
<CascadingAuthenticationState>
<CascadingValue Value="@PageState">
<SiteRouter OnStateChange="@ChangeState" />
</CascadingValue>
</CascadingAuthenticationState>
}
else
{
<div class="app-alert">
@_installation.Message
</div>
}
}
}
@code {
private Installation _installation;
private bool _initialized;
private bool _installed;
private PageState PageState { get; set; }
protected override async Task OnParametersSetAsync()
{
var installation = await InstallationService.IsInstalled();
_installed = installation.Success;
_installation = await InstallationService.IsInstalled();
_initialized = true;
}