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

@@ -17,7 +17,7 @@ func (cfg *apiConfig) middlewareAuth(handler authedHandler) http.HandlerFunc {
return
}
user, err := cfg.DB.GetUserByAPIKey(r.Context(), apiKey)
user, err := cfg.DB.GetUser(r.Context(), apiKey)
if err != nil {
respondWithError(w, http.StatusNotFound, "Couldn't get user")
return