Follow-up from "Add Jira connect subscriptions REST API" provide reason for 401
api/v4/integrations/jira_connect/subscriptions
requires authentication in two ways:
- GitLab user authentication with auth token
- Atlassian JWT authentication with JWT token provided in the request body
If one authentication fails, the endpoint will return a 401
error, but the client is not able to tell which authentication method has failed. To fix this, we can:
- Add a reason attribute to
unauthorized!
helper, just like theforbidden!
helper. - Add a reason like
JWT authentication failed
to the error response inapi/v4/integrations/jira_connect/subscriptions