Add comprehensive Clerk authentication system with advanced features: - Implement Clerk authentication provider - Set up protected routes with role-based access control - Configure advanced authentication flows - Add middleware for authentication checks - Implement user session management - Create login, signup, and profile management components This implementation enhances application security and provides a robust authentication solution with seamless user experience.
21 lines
No EOL
523 B
JavaScript
21 lines
No EOL
523 B
JavaScript
import { createEnv } from "@t3-oss/env-nextjs"
|
|
import { z } from "zod"
|
|
|
|
export const env = createEnv({
|
|
server: {
|
|
ANALYZE: z
|
|
.enum(["true", "false"])
|
|
.optional()
|
|
.transform((value) => value === "true"),
|
|
},
|
|
client:{
|
|
NEXT_PUBLIC_CLERK_ENABLE_KEYLESS: z
|
|
.enum(["true", "false"])
|
|
.optional()
|
|
.transform((value) => value === "true")
|
|
},
|
|
runtimeEnv: {
|
|
NEXT_PUBLIC_CLERK_ENABLE_KEYLESS: process.env.NEXT_PUBLIC_CLERK_ENABLE_KEYLESS,
|
|
ANALYZE: process.env.ANALYZE,
|
|
},
|
|
}) |