Logo

Remove Self-Registration

This guide explains how to make your application "invite-only" by removing the ability for users to register themselves. Only administrators will be able to create new user accounts.

Step 1: Disable Registration in Configuration

In appsettings.json, set:

"Registration": {
    "AllowSelfRegistration": false,  // Set to false
    ...
}
Quick Option
If you only want to disable registration temporarily, you can stop here. The Register link will be hidden and the registration page will reject attempts. Continue below to fully remove the feature.

Step 2: Remove Register Link from Navigation

In Pages/Shared/_LoginPartial.cshtml, delete the Register link:

<!-- DELETE this line: -->
<li class="nav-item">
    <a class="nav-link text-dark" asp-page="/Account/Register">Register</a>
</li>

Step 3: Delete Registration Pages

Delete these files from Pages/Account/:

Step 4: Update Login Page

In Pages/Account/Login.cshtml, remove the "Register" link if present:

<!-- DELETE: "New user? Register here" link -->
<p>
    New user? <a asp-page="./Register">Create an account</a>
</p>

Step 5: Remove Configuration Settings

In appsettings.json, you can now remove registration-related settings:

// DELETE this section if fully removing registration:
"Registration": {
    "AllowSelfRegistration": false,
    "RequireApproval": true  // No longer needed
}

Step 6: Clean Up Related Code

Search your codebase for references to registration and remove:

Step 7: Update Admin Dashboard

The Admin section now becomes the only way to create users. Ensure the Pages/Admin/Users/Create.cshtml page works as expected.

Related: Remove Approval Workflow

If you're removing self-registration, you should also remove the approval workflow since it's no longer needed.

Verification

After removal, verify: