21 lines
622 B
C#
21 lines
622 B
C#
using Microsoft.AspNetCore.Authentication;
|
|
using Microsoft.AspNetCore.Authentication.Cookies;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace APP.Helper
|
|
{
|
|
public class MyCookieAuthenticationEvents : CookieAuthenticationEvents
|
|
{
|
|
public override Task RedirectToLogin(RedirectContext<CookieAuthenticationOptions> context)
|
|
{
|
|
//context.RedirectUri = "/login?returnUrl=" + context.HttpContext.Request.Path.Value;
|
|
context.RedirectUri = "/";
|
|
return base.RedirectToLogin(context);
|
|
}
|
|
|
|
}
|
|
}
|