From 299e58db28202be8706dee1c570c382e1489213b Mon Sep 17 00:00:00 2001 From: Jake Mannens Date: Mon, 9 Oct 2023 16:00:18 +1100 Subject: AclDialog --- Controllers/LoginController.cs | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'Controllers') diff --git a/Controllers/LoginController.cs b/Controllers/LoginController.cs index 364bc5e..ebadf37 100644 --- a/Controllers/LoginController.cs +++ b/Controllers/LoginController.cs @@ -11,27 +11,26 @@ namespace HyperBooru.Controllers; [Route("/")] public class LoginController : Controller { private IHttpContextAccessor httpContextAccessor; - private IPrincipalProvider principalProvider; + private ISecurityService securityService; public LoginController( IHttpContextAccessor httpContextAccessor, - IPrincipalProvider principalProvider) { + ISecurityService securityService) { this.httpContextAccessor = httpContextAccessor; - this.principalProvider = principalProvider; + this.securityService = securityService; } [HttpPost("Login")] public async Task Login( [FromForm] string username, - [FromForm] string password, - HBContext db) { + [FromForm] string password) { - var user = principalProvider.GetUser(username); + var user = securityService.GetUser(username); if(user is null) return StatusCode(403); - if(!principalProvider.ValidatePassword(user, password)) + if(!securityService.ValidatePassword(user, password)) return StatusCode(403); var claims = new Claim[] { -- cgit v1.3