#anastasiya-customer-portal

1 messages · Page 1 of 1 (latest)

bold thorn
#

@stark ivy The problem here is that you are redirecting server-side with res.redirect(). This doesn't work if you JS code uses fetch() or any equivalent AJAX request.
You need to tweak your JS code to submit the whole page so that your server can redirect

stark ivy
#

What do you mean by the whole page?

bold thorn
#

I mean that your code is doing a call to fetch() or equivalent. And that can't work. You have to do like a form submission

#

alternatively, return the session.url` in JSON and then client-side parse the JSON and get the URL and redirect

stark ivy
#

The second approach was actually my workaround. But my concern is that when I redirect it on client side it exposes the url. Isn’t it a security issue?

bold thorn
#

I don't think there's any security issue no, the URL is visible no matter what since you redirect to it

stark ivy
#

Hm, okay then. Thank you! 👍