SSR Requirements
This version will be available soon, but for now, please use the SSR version of light-auth.
Understanding when you should use Light-Auth, and when not.
SSR-Only Authentication Framework
Light-Auth is specifically designed to work with frameworks that support server-side rendering (SSR). This architectural decision ensures secure authentication flows, proper cookie handling, and protection of sensitive credentials.
Compatible Frameworks
Next.js
App Router and Pages Router
Astro
With SSR mode enabled
Nuxt.js
Vue-based SSR framework
SvelteKit
Svelte-based SSR framework
Express
Node.js web application framework
Why SSR is recommend ?
Secure Credential Handling
OAuth client secrets and tokens must be handled server-side to prevent exposure in client-side code.
HTTP-Only Cookies
Light-Auth uses HTTP-only cookies for session management, which require server-side processing.
OAuth Callback Handling
OAuth authentication flows require server endpoints to handle callbacks and token exchanges.
Token Refresh
Automatic token refresh mechanisms require server-side processing to securely store and update tokens.
Not Compatible with Client-Side Only Applications
Light-Auth is not compatible with client-side only applications built with frameworks like:
Framework | Type | Compatibility |
---|---|---|
React with Vite | Client-side only | Not Compatible |
Create React App | Client-side only | Not Compatible |
Vue with Vite | Client-side only | Not Compatible |
Static Site Generators | Pre-rendered static sites | Not Compatible |