diff options
| author | Jake Mannens <jake@asger.xyz> | 2023-10-09 17:50:12 +1100 |
|---|---|---|
| committer | Jake Mannens <jake@asger.xyz> | 2023-10-09 17:50:12 +1100 |
| commit | ea89ec0c1b05ac246f2ffd5907daace27564100b (patch) | |
| tree | 39d870b5167e0cab112a85dadcd8d8e67785b446 /Controllers | |
| parent | 36757ad31901cce4bb55f4911a28bb63ee1dee7a (diff) | |
| parent | 299e58db28202be8706dee1c570c382e1489213b (diff) | |
Merge branch 'security' of gitlab.com:plasmicplexus/HyperBooru-Server into security
Diffstat (limited to 'Controllers')
| -rw-r--r-- | Controllers/LoginController.cs | 13 |
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[] { |
