Moved Models to Shared Project
This commit is contained in:
parent
bae69648d0
commit
7533d5a704
19 changed files with 27 additions and 1 deletions
|
@ -1,32 +0,0 @@
|
|||
using Microsoft.AspNetCore.Authentication;
|
||||
using Microsoft.AspNetCore.Authentication.Cookies;
|
||||
using Microsoft.AspNetCore.DataProtection;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
namespace Lieb.Data
|
||||
{
|
||||
[Route("[controller]/[action]")] // Microsoft.AspNetCore.Mvc.Route
|
||||
public class AccountController : ControllerBase
|
||||
{
|
||||
public IDataProtectionProvider Provider { get; }
|
||||
|
||||
public AccountController(IDataProtectionProvider provider)
|
||||
{
|
||||
Provider = provider;
|
||||
}
|
||||
|
||||
[HttpGet]
|
||||
public IActionResult Login(string returnUrl = "/")
|
||||
{
|
||||
return Challenge(new AuthenticationProperties { RedirectUri = returnUrl }, "Discord");
|
||||
}
|
||||
|
||||
[HttpGet]
|
||||
public async Task<IActionResult> Logout(string returnUrl = "/")
|
||||
{
|
||||
//This removes the cookie assigned to the user login.
|
||||
await HttpContext.SignOutAsync(CookieAuthenticationDefaults.AuthenticationScheme);
|
||||
return LocalRedirect(returnUrl);
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue