-
-
Notifications
You must be signed in to change notification settings - Fork 975
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to set either env or collection variables via collection level Pre Request script #2266
Comments
@XDIJK if this works for you, I'll see about making a contribution updating some docs about authenticating with Cognito. |
@jwsloan Thanks for the response, the actual cognito call is working just fine and as far as I can see/understand the you posted snippet above doesn't really differ from the scripts I posted. Other than on my end However on the first script in the parent post the I am getting a valid authToken back from cognito it is the variable assignment which is failing/not happening. |
I am experiencing the same issue as @jwsloan. Running a collection Pre Request script. the script is getting an auth token, all working fine apart from when I try to set a variable with either: bru.setEnvVar("access_token", neither work! |
@jwsloan Rather odd update it just started working without any changes made nor an update of Bruno. So on my end it is inexplicably working right now. To answer your question above however: |
I have the same issue. Tokens are printed correctly in the dev console but I cannot use the variable in the Auth tab in Env vars seem to me broken in 1.18.1. |
I have checked the following:
Describe the bug
OS & Version
OS: Ubuntu 22.04.4 LTS
Bruno version: V1.17.0 deb pkg
I've been attempting to set any form of variable via a collection level Pre Request script and am seemingly unable to do so. unsure if I am missing something obvious or it is simply not working.
The variable neither can be interpolated in any request nor is it visibly set in the Bruno variables tab.
This was tested both on 1.16.x & on 1.17.0
Similar issue can be found here however none of the work arounds seemed to have worked for me: #1019
Likewise I found some odd behaviour where the request level Post Request script finishes before the Pre Request script does most likely related to some odd async axios behaviour.
Furthermore I have also tried to write the script without async functions and simply awaiting the response of the POST request which simply does not execute the POST not sure what is going on there.
I've also tried creating or removing the variables and letting the script instantiate them but no combination of any of it seems to work.
Pre Request script
Pre Request script without functions as in documentation:
.bru file to reproduce the bug
No response
Screenshots/Live demo link
The text was updated successfully, but these errors were encountered: