Having an incredibly hard time setting up universal login on my SvelteKit app.
Basic structure
root route / along with /docs and some other unprotected routes
/app route this one needs to be protected
Basic goal
Check if user navigates to any route that starts with /app
If it starts with /app validate jwt in cookies
If there is no jwt or it’s not valid, send over to universal login page
Redirect back to /app, create jwt from access token and store in cookies
However, somehow I’m not able to implement this at all using Auth0. I don’t get why this is so difficult. Someone with knowhow on using Auth0 with Svelte who can help me out? How should I set up hooks & layout? Should I keep a store as well? Documentation online seems outdated.
Kind regards and thank you for reading & considering