SvelteKit Auth Flow with OAuth
A complete auth flow using SvelteKit, Lucia Auth, and OAuth 2.0 with GitHub and Google providers, session management, and protected route hooks.
Highlights
- Lucia Auth session management with database-backed sessions and automatic expiry
- OAuth 2.0 multi-provider flow with GitHub and Google for social login
- SvelteKit hooks for protected routes with redirect-back-to-original-URL
- CSRF protection with origin header validation on all mutation requests
Repository
View on GitHub ↗Report a problem with this caseOpens a pre-filled issue on GitHub.