Fix SupplyParameterFromForm usages (#1353)

This commit is contained in:
Leendert de Borst
2025-11-13 20:10:35 +01:00
parent b598e86044
commit 2d24ec366f
5 changed files with 17 additions and 0 deletions

View File

@@ -75,6 +75,11 @@ else
private bool IsAdminConfigured { get; set; } = true;
protected override void OnInitialized()
{
Input ??= new();
}
/// <inheritdoc />
protected override async Task OnInitializedAsync()
{

View File

@@ -52,6 +52,7 @@
/// <inheritdoc />
protected override async Task OnInitializedAsync()
{
Input ??= new();
await base.OnInitializedAsync();
// Ensure the user has gone through the username & password screen first

View File

@@ -36,6 +36,7 @@
/// <inheritdoc />
protected override async Task OnInitializedAsync()
{
Input ??= new();
// Ensure the user has gone through the username & password screen first
user = await SignInManager.GetTwoFactorAuthenticationUserAsync() ??
throw new InvalidOperationException("Unable to load two-factor authentication user.");

View File

@@ -38,6 +38,11 @@
[SupplyParameterFromForm] private InputModel Input { get; set; } = default!;
protected override void OnInitialized()
{
Input ??= new();
}
private async Task OnValidSubmitAsync()
{
var user = await UserManager.FindByIdAsync(UserService.User().Id);

View File

@@ -79,6 +79,11 @@ else
[SupplyParameterFromForm] private InputModel Input { get; set; } = default!;
protected override void OnInitialized()
{
Input ??= new();
}
/// <inheritdoc/>
protected override async Task OnAfterRenderAsync(bool firstRender)
{