insomnia: [Bug] Switching environments will re-use a stale chained request value

  • Insomnia Version: 5.12.4
  • Operating System: Windows 10 Pro (10.0.16299.125)

Details

If a workspace contains a chained request value (e.g. a bearer token) and there is more than one environment (e.g. development and staging), if a request is executed in development that requires a chained request value, that value will persist if switching to the other environments.

Steps to Reproduce

  1. Create “Development” environment
  2. Create “Staging” environment
  3. Create POST request which retrieves OAuth 2.0 Bearer token
  4. Create GET request which requires Authorization: Bearer <token> header
  5. Fill Auth Bearer Token value with Response => Body Attribute macro, executing the POST Token request from Step 3.
  6. Execute request, and ensure bearer token was used in the request successfully
  7. Switch environments
  8. Execute the same request. Note that the previous bearer token was cached and used as part of the request (and, presumably, you will get either a 400 Bad Request or 401 Unauthorized error).

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Reactions: 4
  • Comments: 15 (3 by maintainers)

Most upvoted comments

This is very similar to issue #260 It would be awesome to see these 2 questions solved in a similar manner - like an option at the workspace level to reset all the stored responses/tokens when switching between environments.

Yep, now it won’t close 😄

Sorry about that. I was changing up the issue tag descriptions so the stale bot went on a rampage!

FWIW I just ran into the same issue – we use bearer JWT tokens with multiple environments (dev, staging, prod, etc) and tokens are generated by scoping them to a single environment. Caching them across environments in my case was unexpected. What’s the best way for us to help with this @gschier ?