fix(auth): roll back on commit failure in DeleteSession

Restore the rollback-on-commit-failure that v1's Logout handler had before
this session-deletion logic was extracted, so a failed commit does not leave
the transaction open longer than the deferred Close.
This commit is contained in:
kolaente 2026-06-12 11:05:14 +02:00 committed by kolaente
parent 9aa0687288
commit a32d8d6492
1 changed files with 6 additions and 1 deletions

View File

@ -200,7 +200,12 @@ func DeleteSession(sid string) error {
return err
}
return s.Commit()
if err := s.Commit(); err != nil {
_ = s.Rollback()
return err
}
return nil
}
// ResetPassword resets a user's password from a previously issued reset token