api error: You need to sign in or sign up before continuing. (nginx)
-
When we try to connect using api we get error 401.
As it stands, it has to do with nginx settings:
https://www.chatwoot.com/docs/self-hosted/deployment/caprover#api-requests-failing-with-you-need-to-sign-in-or-sign-up-before-continuing
How do i resolve this issue? -
I just fixed this yesterday. Issue is related to the user of underscores in headers with nginx - https://www.chatwoot.com/docs/self-hosted/deployment/caprover#api-requests-failing-with-you-need-to-sign-in-or-sign-up-before-continuing . I have fixed our code to add that config by default in nginx from the next release. The reason why this is disabled by default is documented here - https://www.nginx.com/resources/wiki/start/topics/tutorials/config_pitfalls/#missing-disappearing-http-headers (it might conflict with CGI headers, which is not a problem for Cloudron).
If you can't wait for the next release, what you can do for the moment is:
-
Edit /home/yellowtent/box/src/nginxconfig.ejs . Then add this line https://git.cloudron.io/cloudron/box/-/commit/9bb5096f1cd8a03d50d5f60ba6eb29dcd56fd9b2
-
After that, go to Cloudron dashboard -> Chatwoot app -> Location page . Then just click save without making any changes. This re-generates the nginx config.
I could verify the above change works. Before making the above change:
$ curl -H 'api_access_token: yy' https://chatwoot.xx/api/v1/accounts/0/teams {"errors":["You need to sign in or sign up before continuing."]}
After making the above change:
$ curl -H 'api_access_token: yy' https://chatwoot.xx/api/v1/accounts/1/teams []
-
-
@yairShiloach its work! thanks
-
@yairShiloach We will have a 7.1.4 later this week or early next week.