blob: 6adfe1f0a5a19cf580a475a130c0cc9b94b9a7c3 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
using System.Threading.Tasks;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Identity;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.RazorPages;
using PCC.Data.Models;
namespace PCC.Web.Areas.Identity.Pages.Account
{
[AllowAnonymous]
public class LogoutModel : PageModel
{
private readonly SignInManager<PCCUser> _signInManager;
public LogoutModel(SignInManager<PCCUser> signInManager)
{
_signInManager = signInManager;
}
public async Task<IActionResult> OnGet(string returnUrl = null)
{
await _signInManager.SignOutAsync();
return Redirect("/");
}
}
}
|