Skip to content

Commit

Permalink
🔒 Make all profile endpoints authenticated.
Browse files Browse the repository at this point in the history
  • Loading branch information
Danieloni1 committed Jun 11, 2024
1 parent b23f241 commit cd43a34
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions clientapi/routing/routing.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)
Expand Down

0 comments on commit cd43a34

Please sign in to comment.