asp.net core redirect to login page with return url code example
Example 1: asp.net core redirecttoaction with parameters
RedirectToAction("Action", "Controller" ,new { id });
Example 2: .net core login redirect loop
// Startup.cs
public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
{
// authentication has to come before authorization, or you get an infinite redirect!
app.UseAuthentication()
app.UseAuthorization()
}