完善授权分页与恢复安全校验
Security Checks / security (push) Waiting to run

This commit is contained in:
xuans committed 2026-09-06 07:22:00 +08:00
1 parent d93337852d
commit dbcfc5c461
6 files changed
+36 -16

No files matched your search

+7
View File
@@ -326,6 +326,13 @@ func (s *Service) CompleteWithContext(ticketID, newPassword, browserContext stri
return ErrRecoveryDenied
}
}
if item.Method == "webauthn" && item.CredentialID > 0 {
var credential models.WebAuthnCredential
found, lookupErr := s.engine.Where("id = ? AND user_id = ? AND revoked_at IS NULL", item.CredentialID, item.UserID).Get(&credential)
if lookupErr != nil || !found {
return ErrRecoveryDenied
}
}
version := user.SessionVersion + 1
if version <= 0 {
version = 1