feat(api-client): update adminApiTypes.d.ts based on the latest API release#2261
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
Pull request overview
This PR fixes a bug where the scopes parameter in OAuth token requests for AdminApiClient was not being transformed to scope as expected by the League OAuth2 server backend. The fix adds a transformation step in the automatic authentication flow that converts scopes to scope before sending credentials to the /oauth/token endpoint.
Changes:
- Modified the authentication logic in
createAdminAPIClient.tsto transformscopestoscopein OAuth token requests - Updated test to verify the scopes-to-scope transformation works correctly
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| packages/api-client/src/createAdminAPIClient.ts | Added logic to destructure scopes from credentials and rename it to scope when making OAuth token requests |
| packages/api-client/src/adminApiClientCredentials.test.ts | Updated test name and expectations to verify scopes is transformed to scope |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 8 out of 10 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
adminApiTypes.d.ts based on the latest API release
Description
closes: #1728
backend issue created: shopware/shopware#14570the issue evolved because it turned out that the backend logic was already fixed and the only thing needed was to update openapi schema definition -> then naturally was to regenerate the types in our api client package to adjust the oauth requests.
Type of change
ToDo's
Screenshots (if applicable)
Additional context