[GH-ISSUE #3720] [bug]: Endless spinner after generation of valid OAUTH2 access token #1286

Open
opened 2026-03-16 19:37:56 +03:00 by kerem · 4 comments
Owner

Originally created by @jordibeen on GitHub (Jan 4, 2024).
Original GitHub issue: https://github.com/hoppscotch/hoppscotch/issues/3720

Is there an existing issue for this?

  • I have searched the existing issues

Current behavior

When trying to add OAuth 2.0 Authorization to the collection I am redirected back to an endless spinner after the challenge.

I've checked the Network tab, and that shows me that an access token was fetched successfully. I have tried pasting this access_token the 'Token' field, and that works.

It looks to be an issue in the logic that's fired after the redirection.

See gif and screenshot below.
endlesspsinner
Being redirected back to the endless spinner after the OAuth challenge

token

The network tab showing valid tokens

Steps to reproduce

  1. Go to the Authorization properties of the collection
  2. Select OAuth 2.0 as Authorization Type
  3. Enter valid OAuth 2.0 details
  4. Click "Generate Token"

Environment

Production

Version

Self-hosted

Originally created by @jordibeen on GitHub (Jan 4, 2024). Original GitHub issue: https://github.com/hoppscotch/hoppscotch/issues/3720 ### Is there an existing issue for this? - [X] I have searched the existing issues ### Current behavior When trying to add OAuth 2.0 Authorization to the collection I am redirected back to an endless spinner after the challenge. I've checked the Network tab, and that shows me that an access token was fetched successfully. I have tried pasting this `access_token` the 'Token' field, and that works. It looks to be an issue in the logic that's fired after the redirection. See gif and screenshot below. ![endlesspsinner](https://github.com/hoppscotch/hoppscotch/assets/9075454/fa82ef93-c95d-46cb-b3bf-78db04090bff) _Being redirected back to the endless spinner after the OAuth challenge_ <img width="1920" alt="token" src="https://github.com/hoppscotch/hoppscotch/assets/9075454/f26ade89-8971-4cbb-9f83-13b59f26b9d0"> _The network tab showing valid tokens_ ### Steps to reproduce 1. Go to the Authorization properties of the collection 2. Select OAuth 2.0 as Authorization Type 3. Enter valid OAuth 2.0 details 4. Click "Generate Token" ### Environment Production ### Version Self-hosted
Author
Owner

@liyasthomas commented on GitHub (Jan 4, 2024):

@amk-dev can you look into this?

<!-- gh-comment-id:1877559553 --> @liyasthomas commented on GitHub (Jan 4, 2024): @amk-dev can you look into this?
Author
Owner

@jordibeen commented on GitHub (Jan 9, 2024):

I've noticed that this happens when the active request that you are redirected to has "Authorization type" set to "Inherit". This unfortunately makes the Inherit option unusable for now.

image
<!-- gh-comment-id:1882799629 --> @jordibeen commented on GitHub (Jan 9, 2024): I've noticed that this happens when the active request that you are redirected to has "Authorization type" set to "Inherit". This unfortunately makes the Inherit option unusable for now. <img width="360" alt="image" src="https://github.com/hoppscotch/hoppscotch/assets/9075454/947282ea-5208-48b8-a3a1-8fd6ffb58cdf">
Author
Owner

@ventsislav-georgiev commented on GitHub (Jan 11, 2024):

Hitting the same issue, in my case it does not matter if Inherit is set or not.

Steps:

  1. Clicking Generate Token on the Collection -> Properties -> Authorization tab
  2. Hoppscotch makes GET request to the /authorize endpoint
  3. The browser is redirected properly to authenticate in the IdP and after login is redirected back to Hoppscotch with a code query param
  4. Hoppscotch extracts the code and makes POST request to the /token endpoint with the code and the proper grant_type
  5. Then after the /token endpoint returns 200 with a json response with { access_token }. The code here extracts it successfully: github.com/hoppscotch/hoppscotch@cd371fc9d4/packages/hoppscotch-common/src/helpers/oauth.ts (L299)
  6. The last part of the flow fails here: github.com/hoppscotch/hoppscotch@cd371fc9d4/packages/hoppscotch-common/src/pages/oauth.vue (L72) in the check for the currentActiveTab.
  7. Hoppscotch is left with endless spinner in route https://hop.xxx/oauth?code=... as it does not navigate to /
<!-- gh-comment-id:1886695289 --> @ventsislav-georgiev commented on GitHub (Jan 11, 2024): Hitting the same issue, in my case it does not matter if Inherit is set or not. Steps: 1. Clicking Generate Token on the Collection -> Properties -> Authorization tab 2. Hoppscotch makes GET request to the /authorize endpoint 3. The browser is redirected properly to authenticate in the IdP and after login is redirected back to Hoppscotch with a code query param 4. Hoppscotch extracts the code and makes POST request to the /token endpoint with the code and the proper grant_type 5. Then after the /token endpoint returns 200 with a json response with { access_token }. The code here extracts it successfully: https://github.com/hoppscotch/hoppscotch/blob/cd371fc9d4a1b2645bbaf733090c10e2d3355165/packages/hoppscotch-common/src/helpers/oauth.ts#L299 6. The last part of the flow fails here: https://github.com/hoppscotch/hoppscotch/blob/cd371fc9d4a1b2645bbaf733090c10e2d3355165/packages/hoppscotch-common/src/pages/oauth.vue#L72 in the check for the currentActiveTab. 7. Hoppscotch is left with endless spinner in route `https://hop.xxx/oauth?code=...` as it does not navigate to `/`
Author
Owner

@ventsislav-georgiev commented on GitHub (Feb 10, 2024):

Any update here?

<!-- gh-comment-id:1937259675 --> @ventsislav-georgiev commented on GitHub (Feb 10, 2024): Any update here?
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/hoppscotch#1286
No description provided.