realworld
realworld copied to clipboard
Session does not perssists after refresh
I noticed that this code does not prevent sessions to be lost after a page refresh. Should it work that way?
@codewithpatelo, use express-session and store session. it will keep session!
Any chance you can point in the right direction? I seem to struggle to find a working solution
The "user" object gets nested on page refresh, its there it just gets undefined due to nesting. In your " login/index.svelte " change lines 26 - 29 to be if (response.token) { $session.user = response; goto('/'); }
and in " auth/login.js " change the user object to be if (response.user) req.session.user = {"id": 1234, "email": "[email protected]", "username": "test", "token": "tesssttttt", "bio":null, "image": null}
A more actively maintained version now lives at https://github.com/sveltejs/kit/tree/master/examples/realworld.svelte.dev
A more actively maintained version now lives at https://github.com/sveltejs/kit/tree/master/examples/realworld.svelte.dev
Gives 404
The realworld team would not list projects in a monorepo, so we moved it back here
closing as out of date