Re:
by ervine on Friday November 29, 2024 @12:02PM
(#42275196)
What kind of stuff do you give up with an SPA?
[ Parent
| on HN ]
You give up server redirects and cookie auth. (well you don't lose cookie auth, but you need extra steps for it to prevent CSRF)
Re:
by stackghost on Friday November 29, 2024 @02:11PM
(#42276220)
You can just have the server return a json object instructing the frontend to navigate, accomplishing server redirects.
Javascript can do browser redirects, but those are not actual 301 HTTP redirects.
Re:
by stackghost on Friday November 29, 2024 @08:44PM
(#42278743)
Yes, what I'm saying is that you can have the backend return e.g. "{ "response": 301, "redirectUrl": "https://example.com" }", and then have the frontend handle that properly, and you get the functional equivalent.
I'm aware that it is different under the hood.