diff --git a/src/AndreGoepel.AppFoundation/Components/Pages/Setup.razor b/src/AndreGoepel.AppFoundation/Components/Pages/Setup.razor index 536a2c6..be739c6 100644 --- a/src/AndreGoepel.AppFoundation/Components/Pages/Setup.razor +++ b/src/AndreGoepel.AppFoundation/Components/Pages/Setup.razor @@ -8,6 +8,7 @@ @using AndreGoepel.AppFoundation @using Microsoft.AspNetCore.Identity @using Microsoft.AspNetCore.WebUtilities +@using Microsoft.Extensions.Options @using global::Marten @inject IQuerySession QuerySession @@ -20,6 +21,7 @@ @inject NavigationManager NavigationManager @inject NotificationService NotificationService @inject LoginTokenProtector LoginTokens +@inject IOptions IdentityOptions Initial Setup – nerdventures.blog @@ -49,7 +51,7 @@ Name="Password" Style="width:100%" /> - + @@ -85,6 +87,8 @@ private InputModel Input { get; set; } = new(); private bool isProcessing; + private int MinPasswordLength => IdentityOptions.Value.Password.RequiredLength; + protected override async Task OnInitializedAsync() { if (await SetupCompletion.IsCompleteAsync(QuerySession)) @@ -199,7 +203,7 @@ public string Email { get; set; } = ""; [Required(ErrorMessage = "Password is required")] - [StringLength(100, MinimumLength = 6, ErrorMessage = "The {0} must be at least {2} and at max {1} characters long.")] + [StringLength(100, MinimumLength = 12, ErrorMessage = "The {0} must be at least {2} and at max {1} characters long.")] [DataType(DataType.Password)] public string Password { get; set; } = "";