mirror of
https://gitee.com/dotnetchina/OpenAuth.Net.git
synced 2025-09-20 18:47:55 +08:00
转移.net core 3.1,为.NET 5做准备
This commit is contained in:
20
OpenAuth.Mvc/Controllers/RedirectsController.cs
Normal file
20
OpenAuth.Mvc/Controllers/RedirectsController.cs
Normal file
@@ -0,0 +1,20 @@
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
namespace OpenAuth.Mvc.Controllers
|
||||
{
|
||||
public class RedirectsController : Controller
|
||||
{
|
||||
/// <summary>
|
||||
/// oauth认证跳转页面
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[Authorize]
|
||||
public ActionResult IdentityAuth()
|
||||
{
|
||||
if (User.Identity.IsAuthenticated)
|
||||
return Redirect("/Home/Index");
|
||||
return View();
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user