$ show nextauthjs/sveltekit-auth-example
This is a SvelteKit application demonstrating authentication using Auth.js. It provides sign-in with multiple providers (Google, GitHub, etc.) and protects a route requiring authentication. The application consists of standard SvelteKit routes, components for UI (header, footer, sign-in button), and centralized authentication configuration in auth.ts. The session is managed via cookies and made available to all pages through a layout load function. The code follows SvelteKit conventions and uses Auth.js's SvelteKit adapter for authentication handling.
The LLM identified 1 files worth highlighting for reuse:
A reusable Svelte component that renders a sign-in button for a specific authentication provider. It takes a provider object with signinUrl, callbackUrl, and name properties, and renders a form that submits to the provider's sign-in URL. This component encapsulates the pattern for provider-specific sign-in buttons and can be easily reused in any Svelte project using Auth.js with minimal modification.