29 lines
665 B
C#
29 lines
665 B
C#
using System.CodeDom.Compiler;
|
|
using Microsoft.AspNetCore.Identity;
|
|
using Microsoft.AspNetCore.Mvc;
|
|
|
|
namespace OneForMe.Controllers;
|
|
|
|
[Route("[controller]")]
|
|
public class AccountController : Controller
|
|
{
|
|
private readonly SignInManager<IdentityUser> _signInManager;
|
|
|
|
public AccountController(SignInManager<IdentityUser> signInManager)
|
|
{
|
|
_signInManager = signInManager;
|
|
}
|
|
|
|
[HttpGet("Login")]
|
|
public IActionResult Login()
|
|
{
|
|
return View();
|
|
}
|
|
|
|
[HttpGet("Logout")]
|
|
public async Task<IActionResult> Logout()
|
|
{
|
|
await _signInManager.SignOutAsync();
|
|
return RedirectToAction("Index", "Home");
|
|
}
|
|
} |