Logo

Remove Registration Approval Workflow

This guide explains how to remove the registration approval workflow, allowing users to access the application immediately after registering.

Option A: Just Disable Approval

The simplest approach is to disable approval in configuration:

"Registration": {
    "AllowSelfRegistration": true,
    "RequireApproval": false  // Users can log in immediately
}
That's It!
If you just want immediate registration, the above is all you need. Continue below only if you want to fully remove the approval feature.

Option B: Completely Remove Approval Feature

Step 1: Remove Configuration

In appsettings.json, remove the RequireApproval setting:

"Registration": {
    "AllowSelfRegistration": true
    // DELETE: "RequireApproval": true/false
}

Step 2: Delete Pending Users Admin Pages

Delete the entire Pages/Admin/PendingUsers/ folder:

Step 3: Delete Registration Pending Page

Delete from Pages/Account/:

Step 4: Update Registration Logic

In Pages/Account/Register.cshtml.cs, remove approval-related code:

// DELETE: Approval check
var requireApproval = _configuration.GetValue<bool>("Registration:RequireApproval");
if (requireApproval)
{
    user.PendingApproval = true;
    // ... approval logic
}

// KEEP only the direct login logic

Step 5: Update Login Logic

In Pages/Account/Login.cshtml.cs, remove the pending approval check:

// DELETE: Pending approval check
if (user.PendingApproval)
{
    ModelState.AddModelError(string.Empty, "Your registration is pending approval.");
    return Page();
}

Step 6: Update Admin Navigation

In Pages/Admin/Index.cshtml, remove the Pending Users link and count:

<!-- DELETE: Pending Users card/link -->
<div class="card">
    <div class="card-body">
        <h5>Pending Users</h5>
        ...
    </div>
</div>

Step 7: Remove Notification Emails

Search for and remove email sending code related to:

Step 8: Optional Database Cleanup

The PendingApproval column in AspNetUsers can remain, but you may want to create a migration to remove it:

// In Package Manager Console:
Add-Migration RemovePendingApproval

// In the migration Up() method:
migrationBuilder.DropColumn(
    name: "PendingApproval",
    table: "AspNetUsers");

Verification

After removal, verify: