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

Authorization popup not updating when switching between specs #6537

Closed
mbaeuerle opened this issue Oct 20, 2020 · 4 comments · Fixed by #7046
Closed

Authorization popup not updating when switching between specs #6537

mbaeuerle opened this issue Oct 20, 2020 · 4 comments · Fixed by #7046

Comments

@mbaeuerle
Copy link
Contributor

mbaeuerle commented Oct 20, 2020

Q&A (please complete the following information)

  • OS: Ubuntu 18.04
  • Browser: Firefox (also Chrome 86.0.4240.75)
  • Version: 81.0.2
  • Method of installation: npm using swagger-ui-dist
  • Swagger-UI version: starting 3.25.1 (until newest)
  • Swagger/OpenAPI version: OpenAPI 3.0

Content & configuration

Example Swagger/OpenAPI definition:

From Gist https://gist.github.com/mbaeuerle/64e6da854f92cfb0d4f5c1ddd1d75a8c

Swagger-UI configuration options:

Describe the bug you're encountering

  • The authorization mechanism pop up is not updating when switching between OpenAPI specifications in the drop down, it's always using the authorization of the spec loaded first.

To reproduce...

Steps to reproduce the behavior:

  1. Go to https://petstore.swagger.io/ load the first YAML from above and check the authorization mechanism by selecting "Authorize" (shows API token & Basic Auth)
  2. Load the second YAML
  3. Check the authorization mechanism again, it still shows the Auth from before (API token & Basic Auth instead of basic auth only)

Expected behavior

  • After changing the spec from the drop down the authorization pop up should show the authorization methods for the new spec only

Additional context or thoughts

  • I tracked down that this behaviour started to occur with version 3.25.1. The previous version 3.25.0 does not have this issue.
  • SwaggerUI version 3.25.1 is using SwaggerJS 3.10.1. It could also be an issue there
  • I can verify this issue also with the drop down mechanism (using specific urls)
@hkosova
Copy link
Contributor

hkosova commented Oct 20, 2020

Related (or duplicate): #5540

@mbaeuerle
Copy link
Contributor Author

@hkosova its only a little bit related. In the other issue I showed that one stays logged in when switching the spec.
Here it is about a bug which doesn't even show the authorization mechanisms of the newly loaded spec.

@mbaeuerle
Copy link
Contributor Author

mbaeuerle commented Oct 20, 2020

It's interesting, because when switching between the PetStore example and one of my Gists seem to work without issues. The main difference seems like Petstore is using Swagger 2.0 whereas the Gists use OpenAPI 3.0.
I added a third example using Swagger 2.0 https://gist.githubusercontent.com/mbaeuerle/64e6da854f92cfb0d4f5c1ddd1d75a8c/raw/d3a727f0b6a3f71db463a10d6e3cbf0169c5fe0e/third.yaml which does not show these issues.
It seems like this issue only appears when switching between OpenAPI 3.0 specs.

@mathis-m
Copy link
Contributor

mathis-m commented Mar 8, 2021

Have added the auth data flush on url change with #7046.

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

Successfully merging a pull request may close this issue.

4 participants