api-console
api-console copied to clipboard
OAuth request elements are duplicated in the API console and API request panel
Current examples of element and standalone API console include oauth1-authorization
and oauth2-authorization
handlers in both, the API console and the api-request-editor
component which results in OAuth-related request events fired twice.
Expected outcome
OAuth request handlers should be included in either the API console or the request editor.
Actual outcome
OAuth request handlers included in both elements.
Steps to reproduce
- Clone the git repo, run
npm i
andnpm start
after the installation. - In the opened browser tab, open the "API console as a standalone application" link or the "API console as a web component" link.
- Open any API endpoint method and open the request panel.
- Inspect the page code in browser's developer tools and search for
<oauth2-authorization
. See two entries instead of only one.
Additional information
OAuth handlers are included here https://github.com/advanced-rest-client/api-request/blob/stage/src/ApiRequestEditorElement.js#L986 Standalone API console also includes it here https://github.com/mulesoft/api-console/blob/master/src/ApiConsoleApp.js#L429 The API console element includes it here https://github.com/mulesoft/api-console/blob/master/demo/element/app.js#L65
Was this working before?
- [ ] Yes, it was working before
- [ ] No, it was already broken
- [x] I don't know / not sure
Affected browsers
- [x] All
- [ ] Chrome
- [ ] Firefox
- [ ] Internet Explorer <\3
- [ ] Edge
- [ ] Safari
- [ ] Other (please, specify)
Any progress on this issue? It's just about removing it from one place or another, and rate limits are no joke in some cases.
I workarounded this by overriding it with my own _helpersTemplate()
in the extending class, but still I guess it should be up to implementer, not the request panel.
These 2 components should only be included in the api-console-app
. For any other use case they should be included separately or the events should be handled by the hosting application. @TwoPlusTwoOne can you please take a look?