Fix redirect after totp enroll

This commit is contained in:
William Bouzourène 2025-01-05 14:45:44 +01:00
parent ee9a453f63
commit 3e7aa8e8f5
Signed by: bouzoure
SSH key fingerprint: SHA256:19MbXpLua4rUtk8tunMesD8KUKb91LXLHg8E/qTooww

View file

@ -90,10 +90,6 @@ func TotpEnrollPage(c *fiber.Ctx) error {
}
sess.Set("totp-verified", "yes")
err = sess.Save()
if err != nil {
return err
}
redirectId := c.Query("redirect")
redirectUrl := "/"
@ -107,6 +103,11 @@ func TotpEnrollPage(c *fiber.Ctx) error {
}
}
err = sess.Save()
if err != nil {
return err
}
return c.Redirect(redirectUrl)
} else {
mfaError = "Code temporaire invalide"