Changeset 0.8.2 (#45)

This commit is contained in:
2026-02-22 01:56:58 +00:00
parent c0d95fd7f5
commit 5111d595f7
14 changed files with 642 additions and 6 deletions

View File

@@ -153,6 +153,9 @@ func (h *AuthHandler) Register(c *gin.Context) {
"message": "Account created and pending admin approval",
"pending": true,
})
AuditLogWithActor(user.ID, c, "user.register", "user", user.ID, map[string]interface{}{
"username": req.Username, "pending": true,
})
return
}
@@ -164,6 +167,9 @@ func (h *AuthHandler) Register(c *gin.Context) {
}
c.JSON(http.StatusCreated, resp)
AuditLogWithActor(user.ID, c, "user.register", "user", user.ID, map[string]interface{}{
"username": req.Username, "pending": false,
})
}
// IsRegistrationEnabled checks the global_settings table.
@@ -307,6 +313,7 @@ func (h *AuthHandler) Login(c *gin.Context) {
}
c.JSON(http.StatusOK, resp)
AuditLogWithActor(user.ID, c, "user.login", "user", user.ID, nil)
}
// ── Refresh ─────────────────────────────────