fix some security issues
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user