Auth added to blazor
This commit is contained in:
16
Web/Pages/Logout.cshtml.cs
Normal file
16
Web/Pages/Logout.cshtml.cs
Normal file
@@ -0,0 +1,16 @@
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.AspNetCore.Authentication;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.AspNetCore.Mvc.RazorPages;
|
||||
|
||||
namespace Web.Pages
|
||||
{
|
||||
public class Logout : PageModel
|
||||
{
|
||||
public async Task<IActionResult> OnGet()
|
||||
{
|
||||
await HttpContext.SignOutAsync();
|
||||
return Redirect("/");
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user