api error: You need to sign in or sign up before continuing. (nginx)
-
wrote on Mar 14, 2022, 12:14 PM last edited by
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 []
-
-
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 []
wrote on Mar 14, 2022, 4:48 PM last edited by@girish Thanks for the comment!
Is there an estimate of when the update should come out?
We want to make as few code changes as possible to ensure there are no other glitches in the future, and stick to your versions -
-
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?wrote on Mar 14, 2022, 6:25 PM last edited by@yairShiloach its work! thanks
-
@girish Thanks for the comment!
Is there an estimate of when the update should come out?
We want to make as few code changes as possible to ensure there are no other glitches in the future, and stick to your versions@yairShiloach We will have a 7.1.4 later this week or early next week.