Quick and easy SvelteKit setup using universal login page

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

  1. Check if user navigates to any route that starts with /app
  2. If it starts with /app validate jwt in cookies
  3. If there is no jwt or it’s not valid, send over to universal login page
  4. 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

Hi @robsyc,

Welcome to the Auth0 Community!

Unfortunately, we do not have a SvelteKit example or SDK at the moment.

In this case, I recommend referring to this related post on a workaround to integrating Auth0 with your SvelteKit app.

Thanks,
Rueben

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.