This is a small app, detailing a way to implement JWT auth in SvelteKit using jose (a JSON Object Signing and Encryption package). Tailwind is also used for some basic styling.
You should be able to understand the basic flow stateless auth and what access tokens are and what refresh tokens are. Feel free to take a look at the code or even write it down to better learn these concepts.
I would recommend checking out the explain.md file, that should clear up most questions related to web security and/or specifics in this demo. You should also be able to piece together what needs to be removed if you don't want refresh tokens in your app.
To run the app, just:
npm inpm run dev (uses Vite)That's it. Hopefully this helps!