Repository navigation
New accounts wait for your approval before they can sign in - #66
Merged
Merged
Conversation
Anyone can still fill in the sign-up form, but the new account can't log in until an admin approves it. Admins approve or decline from a new "Accounts waiting for approval" section in Settings (GET/POST/DELETE /api/admin/users). Declining deletes the waiting account; approved accounts can't be declined. - AppUser.IsApproved; the migration approves every existing account. - ApprovalSignInManager checks approval only after a correct password, so a wrong password says nothing about whether an account is waiting, and wrong guesses still count toward the lockout. - The configured admin (Admin:Email) is approved along with the role. - Off for local development (appsettings.Development.json, docker compose) with Registration:RequireApproval=false. - Sign-up page says accounts need approval and shows "waiting for approval" after signing up; login says the same for a waiting account. Tests: 7 API tests (AccountApprovalTests) and 6 page tests, written to fail first; existing tests approve the users they create. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EBixe8vfgVXDMVRMicQbiC
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
New accounts can't sign in until an admin approves them. Anyone can still fill in the sign-up form, but nothing past the login page works for them until you approve.
For you (the admin): Settings now has an Accounts waiting for approval section, which only admins see. Each waiting account has Approve and Decline. Declining deletes the waiting account, and it never works on an approved one.
For new users:
Existing accounts: the migration approves every account that already exists, so nobody is locked out, and the configured admin account is always approved.
Security detail: approval is checked only after a correct password. A wrong password gets the usual "Invalid email or password", so nobody can tell which emails are waiting, and wrong guesses still count toward the lockout.
Local development: approval is off there (
appsettings.Development.jsonand docker compose setRegistration__RequireApproval=false).Tests: 7 new API tests and 6 new page tests, all written to fail first. 421 API tests and 93 Angular tests pass, and the production build is clean. One migration adds the
IsApprovedcolumn and approves existing users.Generated by Claude Code