I'm using asp.net core with mvc, In my application there is an account controller with register and login actions like as below.
[HttpPost]
[AllowAnonymous]
[ValidateAntiForgeryToken]
public async Task<IActionResult> Register(LoginViewModel loginViewModel)
[HttpPost]
[AllowAnonymous]
[ValidateAntiForgeryToken]
public async Task<IActionResult> Login(LoginViewModel loginViewModel)
I want to login the user on a successful registration without duplicating the login code in the register action, so in short, How do I redirect the register post to the login post with the LoginViewModel on submitted?
Is it possible to simply call the login action directly from the register action ?
I'm using the same object for the sake of simplicity/compatibility.