fix: purge authentication data on hard user deletion (#6168)

* fix: purge authentication data on hard user deletion

* fix: fail closed when 2FA status lookup fails

* fix: reject stale Telegram login callbacks

* fix(twofa): prevent concurrent backup code and lockout bypasses

* fix(auth): harden user deletion and Telegram verification
This commit is contained in:
Seefs
2026-07-14 14:25:54 +08:00
committed by GitHub
parent 7c28993f6b
commit b6b97a66e3
8 changed files with 371 additions and 51 deletions
+7
View File
@@ -505,6 +505,13 @@ func InvalidateUserTokensCache(userId int) error {
Find(&tokens).Error; err != nil {
return err
}
return invalidateTokensCache(tokens)
}
func invalidateTokensCache(tokens []Token) error {
if !common.RedisEnabled {
return nil
}
var firstErr error
for _, t := range tokens {
if t.Key == "" {