How to customize ASP.NET Identity Core Username to allow special characters and space

后端 未结 6 1413
没有蜡笔的小新
没有蜡笔的小新 2020-12-20 18:16

I have changed my Register Action Method to accept user Name instead of Email.

if (ModelState.IsValid)
{
    var user = new ApplicationUser          


        
6条回答
  •  忘掉有多难
    2020-12-20 18:35

    services.AddIdentity(options => { options.User.AllowedUserNameCharacters = String.Empty; options.User.RequireUniqueEmail = true; })
                .AddEntityFrameworkStores().AddDefaultTokenProviders();
    

提交回复
热议问题