modrinth / labrinth

Our Rust-based backend utilizing the actix-web framework to serve Modrinth's API.

Home Page:https://modrinth.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

PATCH to /team/:id/members/:user fails when used with username rather than ID

brawaru opened this issue · comments

Describe the bug

According to the documentation, the PATCH team/:id/members/:user endpoint should accept both the user ID and username for the :user pathname parameter 1. However, when called with the username, the endpoint will return 401 (Unauthorized) with the error message telling that the current user has no permissions to edit the team, despite being a literal owner of the project.

Steps to reproduce

  1. Send a PATCH request to team/:id/members/:user with the username as a :user pathname parameter.

Expected behavior

The response succeeds and the member gets changed, just like it does when the user ID used instead.

Additional context

N/A

Footnotes

  1. https://docs.modrinth.com/#tag/teams/operation/modifyTeamMember