Changeset 0.8.2 (#45)
This commit is contained in:
@@ -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 ─────────────────────────────────
|
||||
|
||||
Reference in New Issue
Block a user