News for hackers. Stuff that matters.
Re: by ervine on Friday November 29, 2024 @12:02PM (#42275196)
What kind of stuff do you give up with an SPA?
Re: by nurettin on Friday November 29, 2024 @01:13PM (#42275767)
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.
Re: by ftmch on Friday November 29, 2024 @06:19PM (#42277995)
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.