summaryrefslogtreecommitdiff
path: root/Controllers/LoginController.cs
diff options
context:
space:
mode:
authorJake Mannens <jake@asger.xyz>2023-10-09 16:00:18 +1100
committerJake Mannens <jake@asger.xyz>2023-10-09 16:00:18 +1100
commit299e58db28202be8706dee1c570c382e1489213b (patch)
tree9276a024702e7596cd58c72337c29955fafa98e2 /Controllers/LoginController.cs
parent2c30354c4af308bf9856a3651d9ba3a686eed936 (diff)
AclDialog
Diffstat (limited to 'Controllers/LoginController.cs')
-rw-r--r--Controllers/LoginController.cs13
1 files changed, 6 insertions, 7 deletions
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<IActionResult> 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[] {