feat: dashboard, Convex auth, UI components, and LemonSpace branding
- Add dashboard shell with auth integration - Wire Better Auth / Convex (client, server, HTTP routes) - Add shadcn-style UI primitives and logo assets - Update global styles and landing page - Add internal docs (.docs) Made-with: Cursor
This commit is contained in:
7
lib/auth-client.ts
Normal file
7
lib/auth-client.ts
Normal file
@@ -0,0 +1,7 @@
|
||||
import { createAuthClient } from "better-auth/react";
|
||||
import { convexClient } from "@convex-dev/better-auth/client/plugins";
|
||||
|
||||
// Next.js: kein crossDomainClient nötig (same-origin via API Route Proxy)
|
||||
export const authClient = createAuthClient({
|
||||
plugins: [convexClient()],
|
||||
});
|
||||
19
lib/auth-server.ts
Normal file
19
lib/auth-server.ts
Normal file
@@ -0,0 +1,19 @@
|
||||
import { convexBetterAuthNextJs } from "@convex-dev/better-auth/nextjs";
|
||||
|
||||
export const {
|
||||
handler, // Route Handler für /api/auth/*
|
||||
preloadAuthQuery, // SSR: Query mit Auth vorladen
|
||||
isAuthenticated, // Check ob User eingeloggt ist
|
||||
getToken, // JWT Token abrufen
|
||||
fetchAuthQuery, // Server-side: Convex Query mit Auth
|
||||
fetchAuthMutation, // Server-side: Convex Mutation mit Auth
|
||||
fetchAuthAction, // Server-side: Convex Action mit Auth
|
||||
} = convexBetterAuthNextJs({
|
||||
convexUrl: process.env.NEXT_PUBLIC_CONVEX_URL!,
|
||||
convexSiteUrl: process.env.NEXT_PUBLIC_CONVEX_SITE_URL!,
|
||||
// JWT-Caching für schnellere SSR (optional, aber empfohlen)
|
||||
jwtCache: {
|
||||
enabled: true,
|
||||
isAuthError: (error) => /auth/i.test(String(error)),
|
||||
},
|
||||
});
|
||||
6
lib/auth.ts
Normal file
6
lib/auth.ts
Normal file
@@ -0,0 +1,6 @@
|
||||
import { betterAuth } from "better-auth";
|
||||
|
||||
export const auth = betterAuth({
|
||||
secret: process.env.BETTER_AUTH_SECRET,
|
||||
url: process.env.BETTER_AUTH_URL
|
||||
});
|
||||
Reference in New Issue
Block a user