Skip to content

Allow null on UserOptions.AllowedUserNameCharacters - #67731

Merged
halter73 merged 3 commits into
dotnet:mainfrom
justindbaur:resolve-64078
Jul 17, 2026
Merged

halter73 merged 3 commits into
dotnet:mainfrom
justindbaur:resolve-64078

Conversation

@justindbaur

@justindbaur justindbaur commented Jul 10, 2026 •

Copy link
Copy Markdown
Contributor

Allow null on UserOptions.AllowedUserNameCharacters

  • You've read the Contributor Guide and Code of Conduct.
  • You've included unit or integration tests for your change, where applicable.
  • You've included inline docs for your change, where applicable.
  • There's an open issue for the PR that you are making. If you'd like to propose a new feature or change, please open an issue to discuss the change or find an existing issue.

Allow null on UserOptions.AllowedUserNameCharacters to 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 null is allowed here and has a meaning.

manager.Options.User.AllowedUserNameCharacters = null;

Fixes #64078

Copilot AI review requested due to automatic review settings July 10, 2026 13:32
@dotnet-policy-service dotnet-policy-service Bot added the community-contribution Indicates that the PR has been added by a community member label Jul 10, 2026
@dotnet-policy-service

Copy link
Copy Markdown
Contributor

Thanks for your PR, @justindbaur. Someone from the team will get assigned to your PR shortly and we'll get it reviewed.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.AllowedUserNameCharacters from string to string?.
  • Add XML documentation clarifying the meaning of null for the option.

Co-authored-by: Copilot Autofix powered by AI <[email protected]>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

@halter73
halter73 enabled auto-merge (squash) July 17, 2026 22:11
@halter73
halter73 merged commit d516a8d into dotnet:main Jul 17, 2026
24 checks passed
@dotnet-milestone-bot dotnet-milestone-bot Bot added this to the 11.0-preview7 milestone Jul 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

community-contribution Indicates that the PR has been added by a community member

Projects

None yet

Development

Successfully merging this pull request may close these issues.

UserOptions.AllowedUserNameCharacters should be marked as allowing null.

3 participants