Hacker News new | ask | show | jobs
by geemus 4769 days ago
Interesting. I fear I'm mostly a back-end type of guy (ie not much experience with XMLHttpRequest). Sounds like the browser may be at issue to some extent. I certainly find the behavior you describe to be surprising. Is there something we can change to better facilitate this?
1 comments

It seems to me that the problem is that the backend is treating the XHR like if you were hitting the main site. So sometimes (but not for all endpoints I think), if I were logged out, the XHR would be redirected to the login page.

To me, the API endpoints should behave the same way in a browser as with curl without ever redirecting to the login page.

But, once again, it might have been fixed in the meantime… I haven't tried recently.

Sure. I haven't tried either. Its on my list of stuff to dig into and sort out, so hopefully we have a better answer soon.