feat: add password change and session invalidation

This commit is contained in:
OpenClaw Agent
2026-09-17 02:33:51 +08:00
parent dea1473424
commit a60801173f
3 changed files with 43 additions and 0 deletions
+5
View File
@@ -163,6 +163,11 @@ func (a *App) adminUpdateUser(c *gin.Context) {
if err := tx.Save(&u).Error; err != nil {
return err
}
if in.Password != nil {
if err := tx.Where("user_id = ?", u.ID).Delete(&Session{}).Error; err != nil {
return err
}
}
if in.Role != nil {
if err := tx.Where("user_id = ?", u.ID).Delete(&UserPermission{}).Error; err != nil {
return err