From cd43a34676d2630132d3eaaeba787f61cd441c12 Mon Sep 17 00:00:00 2001 From: Daniel Aloni Date: Tue, 11 Jun 2024 09:58:07 +0300 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=92=20Make=20all=20profile=20endpoints?= =?UTF-8?q?=20authenticated.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- clientapi/routing/routing.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/clientapi/routing/routing.go b/clientapi/routing/routing.go index 4f0f9e489..646377ea2 100644 --- a/clientapi/routing/routing.go +++ b/clientapi/routing/routing.go @@ -900,7 +900,7 @@ func Setup( ).Methods(http.MethodGet, http.MethodOptions) v3mux.Handle("/profile/{userID}/avatar_url", - httputil.MakeExternalAPI("profile_avatar_url", func(req *http.Request) util.JSONResponse { + httputil.MakeAuthAPI("profile_avatar_url", userAPI, func(req *http.Request, device *userapi.Device) util.JSONResponse { vars, err := httputil.URLDecodeMapValues(mux.Vars(req)) if err != nil { return util.ErrorResponse(err) @@ -925,7 +925,7 @@ func Setup( // PUT requests, so we need to allow this method v3mux.Handle("/profile/{userID}/displayname", - httputil.MakeExternalAPI("profile_displayname", func(req *http.Request) util.JSONResponse { + httputil.MakeAuthAPI("profile_displayname", userAPI, func(req *http.Request, device *userapi.Device) util.JSONResponse { vars, err := httputil.URLDecodeMapValues(mux.Vars(req)) if err != nil { return util.ErrorResponse(err)