Configure Microsoft.AspNet.Identity to allow email address as username

前端 未结 13 2052
时光取名叫无心
时光取名叫无心 2020-11-28 20:08

I\'m in the process of creating a new application and started out using EF6-rc1, Microsoft.AspNet.Identity.Core 1.0.0-rc1, Microsoft.AspNet.Identity.EntityFramework 1.0.0-rc

13条回答
  •  星月不相逢
    2020-11-28 20:51

    If you cannot find IdentityConfig.cs then replace your AccountController constructor with this code.

    public AccountController(UserManager userManager)
    {
    UserManager = userManager;
    UserManager.UserValidator = new UserValidator(UserManager) 
      {
          AllowOnlyAlphanumericUserNames = false  
      };
    }
    

提交回复
热议问题