swagger-api / swagger-api/swagger-ui

Json fetch request is not fired on authorization/logout

Open
#4,324 5 comments 12 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

cat: auth type: enhancement
Dominant language
JavaScript
Stars
29k
Forks
9.3k
Avg merge
2d 23h
Merged PRs (30d)
25

Description

Swagger-ui version 3.12.1.

I need to show/hide some endpoints based on the authorization. I.e. after user makes authorization, it should ask server for json and server should return json for authorized user. If user logs out, it should ask for json for anonymous user. To make it happen, swagger-ui should fetch json from server on auth/logout. It worked in prev versions.

Steps to reproduce:

  1. Navigate to http://petstore.swagger.io/
  2. Click Authorize
  3. Fill in api_key auth method with any token and click Authorize, click close.

Expect: swagger-ui should call specActions.download() to download json once again after logged in
Actual: json is not updated

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the flow at http://petstore.swagger.io/ by authorizing with an api_key, then inspect the authorization and logout paths around specActions.download(). Done means the JSON is fetched again after authorization and after logout, so the displayed endpoints update for the current user.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
authentication, frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.