Refactoring authentication to support server-side Blazor using a seamless login flow.
This commit is contained in:
26
Oqtane.Server/Pages/Logout.cshtml.cs
Normal file
26
Oqtane.Server/Pages/Logout.cshtml.cs
Normal file
@ -0,0 +1,26 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Security.Claims;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.AspNetCore.Authentication;
|
||||
using Microsoft.AspNetCore.Authentication.Cookies;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Identity;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.AspNetCore.Mvc.RazorPages;
|
||||
using Oqtane.Models;
|
||||
|
||||
namespace Oqtane.Pages
|
||||
{
|
||||
[IgnoreAntiforgeryToken(Order = 1001)]
|
||||
[AllowAnonymous]
|
||||
public class LogoutModel : PageModel
|
||||
{
|
||||
public async Task<IActionResult> OnPostAsync()
|
||||
{
|
||||
await HttpContext.SignOutAsync(IdentityConstants.ApplicationScheme);
|
||||
|
||||
return LocalRedirect(Url.Content("~/"));
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user