Tuesday, 4 April 2017

I set up session cookies for an API behind a separate SPA. Finished them both. I just signed up for a refactor overhaul didn't I?

So I've been simultaneously developing a restful API and a separate React/Redux frontend. It just came time to connect them. I had set up sessions with client-sessions and built the API exactly how I would have if it had the frontend built in (since this is my first SPA). Now I'm seeing the problem, my frontend routes around without the server, so how can it check session data? Anything conditionally rendered based on sessions has no access to what's happening with the session because it's stranded from the server checks during front end routing. Now I'm googling and seeing things like token-based authentication with JWT and the like... but grrrr... is there a way to make this work with the client-sessions setup I've already come to know and love and fully develop?

Submitted April 04, 2017 at 03:41PM by L000

No comments:

Post a Comment