ssr-auth-integration

Installation
SKILL.md

SSR Auth Integration (Clerk-like JWKS Pattern)

Authentication pattern for server-rendered apps that use eridu_auth as the identity provider without sharing secrets. JWT is stored in an httpOnly cookie, verified locally with JWKS, and refreshed server-side on expiry. Framework-specific glue is kept minimal; the core helpers live in @eridu/auth-sdk/server/ssr.

Canonical Examples

Study these implementations as the source of truth:

File What it demonstrates
apps/eridu_docs/src/lib/auth.ts Astro: shared JWKS/JWT setup, SDK wrappers, cookie helpers
apps/eridu_docs/src/middleware.ts Astro: auth gate — verify → refresh → redirect
apps/eridu_docs/src/pages/auth/callback.ts Astro: token exchange endpoint after IDP login
apps/eridu_docs/src/pages/auth/logout.ts Astro: sign-out endpoint (clear docs cookie + sign out Better Auth session)
apps/eridu_docs/src/config/env.ts Environment config (AUTH_URL, BYPASS_AUTH)
apps/eridu_docs/docs/AUTH_DESIGN.md Full design document with architecture diagram

Package Boundary

Related skills
Installs
1
GitHub Stars
1
First Seen
Mar 31, 2026