Proper login endpoint functionality

This commit is contained in:
Imbus 2024-03-17 01:32:10 +01:00
parent c6d9307979
commit c13378d3b9
2 changed files with 11 additions and 2 deletions

View file

@ -110,8 +110,7 @@ func (gs *GState) Login(c *fiber.Ctx) error {
user := c.FormValue("user")
pass := c.FormValue("pass")
// Throws Unauthorized error
if user != "user" || pass != "pass" {
if !gs.Db.CheckUser(user, pass) {
return c.SendStatus(fiber.StatusUnauthorized)
}