Remove DisabledAt for users

This commit is contained in:
William Bouzourène 2025-01-02 19:50:14 +01:00
parent fa3aa49419
commit 7d71923d4f
Signed by: bouzoure
SSH key fingerprint: SHA256:19MbXpLua4rUtk8tunMesD8KUKb91LXLHg8E/qTooww
3 changed files with 2 additions and 10 deletions

View file

@ -3,7 +3,6 @@ package controllers
import (
"errors"
"fmt"
"time"
"git.readonly.ch/bouzoure/popvaud-people/helpers"
"git.readonly.ch/bouzoure/popvaud-people/models"
@ -33,12 +32,7 @@ func LoginForm(c *fiber.Ctx) error {
password := c.FormValue("password")
var user models.User
result := db.First(
&user,
"LOWER(email) = LOWER(?) AND (disabled_at IS NULL OR disabled_at <= ?)",
email,
time.Now(),
)
result := db.First(&user, "LOWER(email) = LOWER(?)", email)
if result.Error != nil && !errors.Is(result.Error, gorm.ErrRecordNotFound) {
return err