asimons04 / tesseract

GNU Affero General Public License v3.0
26 stars 6 forks source link

Tesseract appears to be attaching "Authorization: Bearer undefined" to logged out requests #1

Closed russjr08 closed 6 months ago

russjr08 commented 6 months ago

What version of Tesseract has this bug? v1.2.9.2

Describe the bug I've just attempted to spin up a new instance of Tesseract, however all pages seem to return an error 500 in the UI, with Failed to fetch homepage. - in the network inspector for my browser, I can see all of the API requests failing with a 401 from Lemmy's API. Upon looking at the requests closer, Tesseract is attaching a bad Authorization header (Authorization: Bearer undefined) it seems.

This is before I've had a chance to login for the first time, and I am unable to login since the login endpoint request itself contains the bad Authorization header, which still triggers a 401 from Lemmy's API.

To Reproduce Steps to reproduce the behavior:

  1. Start a new instance of Tesseract with the provided example docker run command (replacing example.com with our domain of course)
  2. Navigate to the URL of the instance
  3. Attempt to load any page (or simply just try to bring up the default index view)
  4. See error

Expected behavior Tesseract should not attempt to attach an Authorization header until the user has successfully logged in.

Screenshots image

Desktop (please complete the following information):

Additional context This instance of Tesseract is publicly viewable here, and can be reproduced there.

asimons04 commented 6 months ago

Thanks for that. I just pushed a fix up to main as well as pushed new Docker images.

That was a semi-known bug that I just never got around to fixing because it only affected 0.19.2. By the time I got to it, most instances had updated to 0.19.3 which did not experience the issue, and I just kind of forgot about it. Turns out, it was easy to fix once I knew what the underlying problem was, so thanks for providing those details.

I tested the fix against a random 0.19.2 instance, but I couldn't test it against yours directly since yours has CORS headers enabled to only allow ts.bitforged.space as the origin.

If that worked, let me know, and I'll close the issue.

russjr08 commented 6 months ago

Works perfectly, and Tesseract is quite beautiful, so thank you!

asimons04 commented 6 months ago

Good deal. And thanks!

Closing bug since that resolved it. Also merged that fix up to the 1.3.0 version in development.

mitexleo commented 3 days ago

I'm still facing this issue. Any workaround?

asimons04 commented 3 days ago

What version are you using? That should have been fixed back in the 1.2.9.31 maintenance release and then mainlined in 1.3.0.

e2df60389e9a8268f7f538ce2d905e70ccd038fb