#Umbrella-portal
1 messages · Page 1 of 1 (latest)
have you tried window.location.replace @frail cobalt ?
The frontend code is as simple as "make a GET request to our server -> get the url as a response -> open it with window.open(url, '_blank') in a new tab". I can give more details on the backend code in a few hours, I don't have access to it right now
@harsh sedge nope, I'll give it a try
yeah I would just do this by setting window.location and not window.open
if you can share the actual code you use, I can take a look, but really the recommended path is to either directly return a 302 from your backend and redirect from a form action that way , or if you use an XHR-approach like you describe, set window.location instead
Getting the same error when using window.location.replace, unfortunately. Can it be caused by the fact that our API is on a different domain than the website?
it's possible! like when does the error happen exactly?
it sounds like the error happens before this GET happens, so it's not actually part of the Stripe redirect itself, it's your frontend not being able to talk to your backend?
i..e did you actually " get the url as a response" in your code and then the error happens after that, or is the GET itself that fails
It happens as soon as I call window.location.replace with the url that is returned by the API. I can even type the url generated on the server in the browser's address bar and it works
fair enough
I really need to see this in action myself unfortunately, not really possible to say much without having Chrome devtools open and looking at it
like what URL is the OPTIONS request (which is where this error comes from) being made to?
This is the screenshot of my devtools for the request that is failing, not sure if it's helpful
I can send you the backend codes in a few hours
yeah it's because the browser sends an OPTIONS request I suppose