Repository navigation
Allow null on UserOptions.AllowedUserNameCharacters - #67731
Merged
Merged
Conversation
Contributor
|
Thanks for your PR, @justindbaur. Someone from the team will get assigned to your PR shortly and we'll get it reviewed. |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates ASP.NET Core Identity’s UserOptions.AllowedUserNameCharacters to explicitly allow null (via nullable reference types) to represent “no character restrictions,” aligning the API contract with existing runtime behavior.
Changes:
- Update
UserOptions.AllowedUserNameCharactersfromstringtostring?. - Add XML documentation clarifying the meaning of
nullfor the option.
Co-authored-by: Copilot Autofix powered by AI <[email protected]>
halter73
reviewed
Jul 14, 2026
Co-authored-by: Stephen Halter <[email protected]>
justindbaur
force-pushed
the
resolve-64078
branch
from
July 15, 2026 13:08
380c134 to
2fe1741
Compare
Open
3 tasks
halter73
approved these changes
Jul 17, 2026
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.
Allow
nullonUserOptions.AllowedUserNameCharactersAllow
nullonUserOptions.AllowedUserNameCharactersto denote that all characters are allowed in a user name.Description
There are already tests validating that when null is set to this option that non-alphanumeric characters are allowed in user names. This just makes it clear from the type system that
nullis allowed here and has a meaning.aspnetcore/src/Identity/test/Identity.Test/UserValidatorTest.cs
Line 77 in b50ab86
Fixes #64078