fix some security issues

This commit is contained in:
wagslane
2023-06-06 13:33:22 -06:00
parent 307c73e1fb
commit 54f294659f
5 changed files with 10 additions and 7 deletions

View File

@@ -44,7 +44,7 @@ func (cfg *apiConfig) handlerUsersCreate(w http.ResponseWriter, r *http.Request)
return
}
user, err := cfg.DB.GetUserByAPIKey(r.Context(), apiKey)
user, err := cfg.DB.GetUser(r.Context(), apiKey)
if err != nil {
log.Println(err)
respondWithError(w, http.StatusInternalServerError, "Couldn't get user")