Add src/lib/env.ts with runtime Zod validation for NEXT_PUBLIC_* variables. Update auth-server to use validated env instead of process.env directly. Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
16 lines
363 B
TypeScript
16 lines
363 B
TypeScript
import { convexBetterAuthNextJs } from '@convex-dev/better-auth/nextjs';
|
|
|
|
import { env } from './env';
|
|
|
|
export const {
|
|
handler,
|
|
preloadAuthQuery,
|
|
isAuthenticated,
|
|
getToken,
|
|
fetchAuthQuery,
|
|
fetchAuthMutation,
|
|
fetchAuthAction,
|
|
} = convexBetterAuthNextJs({
|
|
convexUrl: env.NEXT_PUBLIC_CONVEX_URL,
|
|
convexSiteUrl: env.NEXT_PUBLIC_CONVEX_SITE_URL,
|
|
});
|