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
- Create “Development” environment
- Create “Staging” environment
- Create POST request which retrieves OAuth 2.0 Bearer token
- Create GET request which requires
Authorization: Bearer <token>
header - Fill Auth Bearer Token value with
Response => Body Attribute
macro, executing the POST Token request from Step 3. - Execute request, and ensure bearer token was used in the request successfully
- Switch environments
- 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)
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 ?