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:
@@ -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 == "" {
|
||||
|
||||
Reference in New Issue
Block a user