👔 Limit max auth steps to 2 for normal users

This commit is contained in:
2025-02-01 19:00:34 +08:00
parent 62a3168190
commit ec0048042a
2 changed files with 6 additions and 5 deletions

View File

@ -62,6 +62,8 @@ func NewTicket(user models.Account, ip, ua string) (models.AuthTicket, error) {
cfg, err := GetAuthPreference(user)
if err == nil && cfg.Config.Data().MaximumAuthSteps >= 1 {
steps = min(steps, cfg.Config.Data().MaximumAuthSteps)
} else {
steps = min(steps, 2)
}
}