diff --git a/internal/api/api.go b/internal/api/api.go index 40667515696..19d5ba62d0c 100644 --- a/internal/api/api.go +++ b/internal/api/api.go @@ -37,7 +37,7 @@ func Serve(router *mux.Router, store *storage.Storage, pool *worker.Pool) { sr.HandleFunc("/users/{userID:[0-9]+}", handler.updateUser).Methods(http.MethodPut) sr.HandleFunc("/users/{userID:[0-9]+}", handler.removeUser).Methods(http.MethodDelete) sr.HandleFunc("/users/{userID:[0-9]+}/mark-all-as-read", handler.markUserAsRead).Methods(http.MethodPut) - sr.HandleFunc("/users/{userID:[0-9]+}/integrations/status", handler.getIntegrationsStatus).Methods(http.MethodGet) + sr.HandleFunc("/users/integrations/status", handler.getIntegrationsStatus).Methods(http.MethodGet) sr.HandleFunc("/users/{username}", handler.userByUsername).Methods(http.MethodGet) sr.HandleFunc("/me", handler.currentUser).Methods(http.MethodGet) sr.HandleFunc("/categories", handler.createCategory).Methods(http.MethodPost) diff --git a/internal/api/user.go b/internal/api/user.go index 57278d3a2e5..112c19a25d4 100644 --- a/internal/api/user.go +++ b/internal/api/user.go @@ -131,11 +131,7 @@ func (h *handler) markUserAsRead(w http.ResponseWriter, r *http.Request) { } func (h *handler) getIntegrationsStatus(w http.ResponseWriter, r *http.Request) { - userID := request.RouteInt64Param(r, "userID") - if userID != request.UserID(r) { - json.Forbidden(w, r) - return - } + userID := request.UserID(r) if _, err := h.store.UserByID(userID); err != nil { json.NotFound(w, r)