Auth impl

This commit is contained in:
2024-01-07 15:52:23 +08:00
parent 632d614d1e
commit 69bae57473
6 changed files with 96 additions and 10 deletions

View File

@ -17,8 +17,7 @@ func NewChallenge(account models.Account, factors []models.AuthFactor, ip, ua st
// Pickup any challenge if possible
if err := database.C.Where(models.AuthChallenge{
AccountID: account.ID,
State: models.ActiveChallengeState,
}).First(&challenge).Error; err == nil {
}).Where("state = ?", models.ActiveChallengeState).First(&challenge).Error; err == nil {
return challenge, nil
}