https://www.growthbook.io/ logo
#announcements
Title
# announcements
s

stocky-terabyte-64429

05/16/2021, 4:39 PM
I have another question, whilst we are exploring the product - how do I run this in dev mode. Because I get JWT errors. Looking at the code it seems I dont need a JWT_SECRET and Token but when we run yarn dev we get an Auth error
f

future-teacher-7046

05/16/2021, 5:22 PM
I'm having trouble reproducing the error you are seeing.
s

stocky-terabyte-64429

05/16/2021, 6:30 PM
I did the following created a test url testgrowthbook.abc.com ran the project as yarn run dev put a nginx in front and configured it Now I am seeing this error {"status":401,"message":"No authorization token was found"}
f

future-teacher-7046

05/16/2021, 6:53 PM
Did you update the .env.local files? They assume you are using localhost by default.
s

stocky-terabyte-64429

05/16/2021, 6:57 PM
Yes, did that also. Now I am able to run it on a localhost but running into another problem. Configured a S3 bucket with CORS policy * (not ideal, I know) Now I am not able to see where to put the Access Key.
f

future-teacher-7046

05/16/2021, 7:06 PM
Ah, that's missing from the documentation right now. We support any of the authentication methods for the aws sdk. The easiest is probably to just add the following to your
packages/back-end/.env.local
file:
Copy code
AWS_ACCESS_KEY_ID=
AWS_SECRET_ACCESS_KEY=
c

curved-zoo-91419

05/16/2021, 7:48 PM
Hi
@future-teacher-7046 We are getting below Error
| UnauthorizedError: No authorization token was found  |   at middleware (/var/www/growthbook/node_modules/express-jwt/lib/index.js7921)  |   at Layer.handle [as handle_request] (/var/www/growthbook/node_modules/express/lib/router/layer.js955)  |   at trim_prefix (/var/www/growthbook/node_modules/express/lib/router/index.js31713)  |   at /var/www/growthbook/node_modules/express/lib/router/index.js2847  |   at Function.process_params (/var/www/growthbook/node_modules/express/lib/router/index.js33512)  |   at next (/var/www/growthbook/node_modules/express/lib/router/index.js27510)  |   at cors (/var/www/growthbook/node_modules/cors/lib/index.js1887)  |   at /var/www/growthbook/node_modules/cors/lib/index.js22417  |   at originCallback (/var/www/growthbook/node_modules/cors/lib/index.js21415)  |   at /var/www/growthbook/node_modules/cors/lib/index.js21913  |   at optionsCallback (/var/www/growthbook/node_modules/cors/lib/index.js1999)  |   at corsMiddleware (/var/www/growthbook/node_modules/cors/lib/index.js2047)  |   at Layer.handle [as handle_request] (/var/www/growthbook/node_modules/express/lib/router/layer.js955)  |   at trim_prefix (/var/www/growthbook/node_modules/express/lib/router/index.js31713)  |   at /var/www/growthbook/node_modules/express/lib/router/index.js2847  |   at Function.process_params (/var/www/growthbook/node_modules/express/lib/router/index.js33512)  |   at next (/var/www/growthbook/node_modules/express/lib/router/index.js27510)  |   at jsonParser (/var/www/growthbook/node_modules/body-parser/lib/types/json.js1107)  |   at Layer.handle [as handle_request] (/var/www/growthbook/node_modules/express/lib/router/layer.js955)  |   at trim_prefix (/var/www/growthbook/node_modules/express/lib/router/index.js31713)  |   at /var/www/growthbook/node_modules/express/lib/router/index.js2847  |   at Function.process_params (/var/www/growthbook/node_modules/express/lib/router/index.js33512) {  |  code: 'credentials_required',  |  status: 401,  |  inner: { message: 'No authorization token was found' }  | }
Can you Please help in this @future-teacher-7046
f

future-teacher-7046

05/16/2021, 8:44 PM
Are you using https? It's possible the browser isn't sending credentials unless it's either localhost or https.
s

stocky-terabyte-64429

05/17/2021, 2:44 AM
Yes we are using https
f

future-teacher-7046

05/17/2021, 1:13 PM
The cloud app is fixed now. Sorry for the long delay, there was a misconfigured authentication rule that took a long time to track down. For the open source version, I suspect it has to do with the CORS configuration. We're still not able to reproduce the issue, but from your error message it seems like the Authorization header is not being sent in the API request. Or possibly nginx is stripping it out before forwarding to nodejs.
s

stocky-terabyte-64429

05/17/2021, 4:09 PM
What header should we look for to solve the Authorization issue and is there anyway to disable it for us to proceed further? We can also do a Google meet session if you are interested in seeing our server.
f

future-teacher-7046

05/17/2021, 4:28 PM
It's the Authorization header.
The first thing the app does is an api request to /auth/refresh which returns a JWT. Then that JWT is added to all future api calls in the Authorization header.
@stocky-terabyte-64429 @curved-zoo-91419 Wanted to follow up and see if you were able to get everything set up or if you're still running into issues. We also just launched our Visual Editor which I know you were interested in. https://docs.growthbook.io/app/visual We're available if you still want to do a Google Meet. https://calendly.com/growthbook
186 Views