FeatureFuel
4

Set an environment variable depending on the last run endpoint

Source: Kong/insomnia#3829 · opened by @jason2li
What is your question?
I'm using JWT authentication. I have a /SignIn endpoint and a /Refresh endpoint. Both of them return the same data model, which includes an access token. I'd like to save the last called endpoint to an environment variable called "accessToken". Is this possible?

What is the context?
In my scenario, the user signs in using the /SignIn endpoint. I then save the response to an environment variable called "accessToken". After a certain amount of time that access token will expire, so they need to refresh it by calling the /Refresh endpoint. Because of this call, the original "accessToken" variable is no longer valid. I would like to update the variable to use the new, valid, access token from the /Refresh endpoint.

My understanding of both "chaining" and "environment variables" is that they can only consume from a single endpoint.

Is there a way to do this?

No pledges yet. Be the first to back this.

Make a pledge

Pledge your monetary support if this feature is added.

$

Comments

No comments yet.

Replying to

Add a comment

What do you think about this feature request?


Similar requests