Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OAuth request elements are duplicated in the API console and API request panel #678

Open
2 of 10 tasks
deiteris opened this issue Mar 8, 2021 · 2 comments
Open
2 of 10 tasks
Assignees

Comments

@deiteris
Copy link

deiteris commented Mar 8, 2021

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

  1. Clone the git repo, run npm i and npm start after the installation.
  2. In the opened browser tab, open the "API console as a standalone application" link or the "API console as a web component" link.
  3. Open any API endpoint method and open the request panel.
  4. 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
  • I don't know / not sure

Affected browsers

  • All
  • Chrome
  • Firefox
  • Internet Explorer <\3
  • Edge
  • Safari
  • Other (please, specify)
@deiteris deiteris changed the title OAuth request elements are duplicated in the API console itself and request panel OAuth request elements are duplicated in the API console and API request panel Mar 8, 2021
@deiteris
Copy link
Author

deiteris commented Aug 15, 2021

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.

@jarrodek
Copy link
Contributor

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants