User1724605321 posted
Hi Samseen ,
You should provide more details , are you using something like ASP.NET Membership Provider /ASP.NET Identity to authenticate or are you writing your own custom authentication layer?
If you are using MVC & Asp.net Identity , i would suggest modify the `Register.cshtml` to include more fields and also `RegisterViewModel` , after user register his account , he will be login by default :
if (result.Succeeded)
{
await SignInManager.SignInAsync(user, isPersistent:false, rememberBrowser:false);
// For more information on how to enable account confirmation and password reset please visit https://go.microsoft.com/fwlink/?LinkID=320771
// Send an email with this link
// string code = await UserManager.GenerateEmailConfirmationTokenAsync(user.Id);
// var callbackUrl = Url.Action("ConfirmEmail", "Account", new { userId = user.Id, code = code }, protocol: Request.Url.Scheme);
// await UserManager.SendEmailAsync(user.Id, "Confirm your account", "Please confirm your account by clicking <a href=\"" + callbackUrl + "\">here</a>");
return RedirectToAction("Index", "Home");
}
Best Regards,
Nan Yu