I hi try to use my custom user store in Microsoft.Identity, but when I try to register a new member(User), after creating the new user I got a null reference exception in the SignInAsync method.
Registeration action:
public async Task<ActionResult> Register(RegisterModel model)
{
if (ModelState.IsValid)
{
var user = new ApplicationUser( Guid.NewGuid( )) {
UserName = model.Username,
Email = model.Username
};
var result = await UserManager.CreateAsync(user, model.Password);
if (result.Succeeded)
{
await SignInManager.SignInAsync(user, isPersistent:false, rememberBrowser:false);
return RedirectToAction("Index", "Home");
}
AddErrors(result);
}
// If we got this far, someth ...
Go to the complete details ...