Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions src/AndreGoepel.AppFoundation/Components/Pages/Setup.razor
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,23 @@

try
{
// Re-assert setup is still incomplete immediately before creating the
// root admin. OnInitializedAsync guards the initial render and the
// SetupRedirectMiddleware blocks fresh GETs of /Setup once an admin
// exists, but neither re-runs for a submit on an already-open circuit —
// so a circuit opened during the first-run window could otherwise mint a
// second root administrator. Fail closed here (#52).
if (await SetupCompletion.IsCompleteAsync(QuerySession))
{
NotificationService.Notify(
NotificationSeverity.Info,
"Setup already completed",
"An administrator account already exists."
);
NavigationManager.NavigateTo("/", forceLoad: true);
return;
}

var user = new User
{
Email = Input.Email,
Expand Down
Loading