Removed the login challenge
This commit is contained in:
parent
5ed00c97d6
commit
023574aac6
|
|
@ -39,7 +39,6 @@ func (lh *LoginHandler) DoLogin(c fiber.Ctx) error {
|
||||||
var req struct {
|
var req struct {
|
||||||
Username string `form:"username"`
|
Username string `form:"username"`
|
||||||
Password string `form:"password"`
|
Password string `form:"password"`
|
||||||
LoginChallenge string `form:"_login_challenge"`
|
|
||||||
}
|
}
|
||||||
if err := c.Bind().Body(&req); err != nil {
|
if err := c.Bind().Body(&req); err != nil {
|
||||||
return c.Status(fiber.StatusBadRequest).SendString("Failed to parse request body")
|
return c.Status(fiber.StatusBadRequest).SendString("Failed to parse request body")
|
||||||
|
|
@ -51,11 +50,6 @@ func (lh *LoginHandler) DoLogin(c fiber.Ctx) error {
|
||||||
|
|
||||||
sess := session.FromContext(c)
|
sess := session.FromContext(c)
|
||||||
|
|
||||||
challenge, _ := sess.Get("_login_challenge").(string)
|
|
||||||
if challenge != req.LoginChallenge {
|
|
||||||
return c.Redirect().To("/login")
|
|
||||||
}
|
|
||||||
|
|
||||||
user, err := lh.AuthService.Login(c.Context(), req.Username, req.Password)
|
user, err := lh.AuthService.Login(c.Context(), req.Username, req.Password)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return c.Status(fiber.StatusInternalServerError).SendString("Failed to login")
|
return c.Status(fiber.StatusInternalServerError).SendString("Failed to login")
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue