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 [] -
-
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 []@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?@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
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login