-
Hi, on __layout.svelte I check if user is authenticated if so I'll show "logout" button, otherwise redirect to "auth/login" page. After login I want to redirect to First on endpoint I set It looks like session is not refreshed correctly on client (i.e handle hook do not run). Or maybe this is an issue with new I find that some people just set window.location, but this not satisfy my needs. But again, this will work only on client side, because it requires to return session in body instead of redirecting. I tested several approaches, none of them work. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
I found a solution exploring svelte real-world example. |
Beta Was this translation helpful? Give feedback.
I found a solution exploring svelte real-world example.
Just use accept header. If it's 'application/json' is client ajax request, like so
https://github.com/wysher/sveltekit-auth-issue/pull/1/files