diff --git a/.env.example b/.env.example index e0d200b..2985555 100644 --- a/.env.example +++ b/.env.example @@ -11,7 +11,7 @@ # General NODE_ENV="development" -SITE_URL="http://localhost:3000" +NEXT_PUBLIC_SITE_URL="http://localhost:3000" # Database DATABASE_HOST="localhost" diff --git a/next-sitemap.config.js b/next-sitemap.config.js index e2b4c5b..3a6914b 100644 --- a/next-sitemap.config.js +++ b/next-sitemap.config.js @@ -2,7 +2,7 @@ import { env } from '@/env'; /** @type {import('next-sitemap').IConfig} */ const config = { - siteUrl: env.SITE_URL, + siteUrl: env.NEXT_PUBLIC_SITE_URL, generateRobotsTxt: true, generateIndexSitemap: false, }; diff --git a/src/components/providers/TRPCProvider.tsx b/src/components/providers/TRPCProvider.tsx index 45b6cad..f7761f1 100644 --- a/src/components/providers/TRPCProvider.tsx +++ b/src/components/providers/TRPCProvider.tsx @@ -34,7 +34,7 @@ function TRPCProvider(props: { children: React.ReactNode }) { }), unstable_httpBatchStreamLink({ transformer: SuperJSON, - url: `${env.SITE_URL}/api/data`, + url: `${env.NEXT_PUBLIC_SITE_URL}/api/data`, headers: () => { const headers = new Headers(); headers.set('x-trpc-source', 'nextjs-react'); diff --git a/src/env.js b/src/env.js index 8fb51cf..c49682a 100644 --- a/src/env.js +++ b/src/env.js @@ -8,7 +8,6 @@ export const env = createEnv({ */ server: { NODE_ENV: z.enum(['development', 'test', 'production']), - SITE_URL: z.string(), DATABASE_HOST: z.string(), DATABASE_PORT: z.string(), DATABASE_USER: z.string(), @@ -32,7 +31,7 @@ export const env = createEnv({ * `NEXT_PUBLIC_`. */ client: { - // NEXT_PUBLIC_CLIENTVAR: z.string(), + NEXT_PUBLIC_SITE_URL: z.string(), }, /** @@ -41,7 +40,7 @@ export const env = createEnv({ */ runtimeEnv: { NODE_ENV: process.env.NODE_ENV, - SITE_URL: process.env.SITE_URL, + NEXT_PUBLIC_SITE_URL: process.env.NEXT_PUBLIC_SITE_URL, DATABASE_HOST: process.env.DATABASE_HOST, DATABASE_PORT: process.env.DATABASE_PORT, DATABASE_USER: process.env.DATABASE_USER, diff --git a/src/server/auth/feide.ts b/src/server/auth/feide.ts index 9502aeb..79cfda6 100644 --- a/src/server/auth/feide.ts +++ b/src/server/auth/feide.ts @@ -11,7 +11,7 @@ const feideOAuthClient = new OAuth2Client( env.FEIDE_AUTHORIZATION_ENDPOINT, env.FEIDE_TOKEN_ENDPOINT, { - redirectURI: `${env.SITE_URL}/api/auth/feide`, + redirectURI: `${env.NEXT_PUBLIC_SITE_URL}/api/auth/feide`, }, );