fix(auth,services,profile): add request struct validation
Add validate tags and validators.Validate.Struct() calls on request structs for auth verification, service creation, and user patch test endpoints. Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
This commit is contained in:
@@ -88,6 +88,10 @@ func CreateServiceHandler(w http.ResponseWriter, r *http.Request) {
|
||||
http.Error(w, "Invalid JSON: "+err.Error(), http.StatusBadRequest)
|
||||
return
|
||||
}
|
||||
if err := validators.Validate.Struct(&req); err != nil {
|
||||
http.Error(w, err.Error(), http.StatusBadRequest)
|
||||
return
|
||||
}
|
||||
|
||||
// Basic validation
|
||||
if req.Name == "" {
|
||||
|
||||
Reference in New Issue
Block a user