-
Notifications
You must be signed in to change notification settings - Fork 323
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'fix-next-public' into docker-emulator
- Loading branch information
Showing
16 changed files
with
96 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 2 additions & 1 deletion
3
apps/dashboard/src/app/(main)/integrations/neon/projects/transfer/confirm/page-client.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,6 +3,7 @@ import { RouterProvider } from '@/components/router'; | |
import { SiteLoadingIndicatorDisplay } from '@/components/site-loading-indicator'; | ||
import { StyleLink } from '@/components/style-link'; | ||
import { ThemeProvider } from '@/components/theme-provider'; | ||
import { getPublicEnvVar } from '@/lib/env'; | ||
import { cn } from '@/lib/utils'; | ||
import { stackServerApp } from '@/stack'; | ||
import { StackProvider, StackTheme } from '@stackframe/stack'; | ||
|
@@ -23,7 +24,7 @@ import './globals.css'; | |
import { CSPostHogProvider, UserIdentity } from './providers'; | ||
|
||
export const metadata: Metadata = { | ||
metadataBase: new URL(process.env.NEXT_PUBLIC_STACK_API_URL || ''), | ||
metadataBase: new URL(getPublicEnvVar('NEXT_PUBLIC_STACK_API_URL') || ''), | ||
title: { | ||
default: 'Stack Auth Dashboard', | ||
template: '%s | Stack Auth', | ||
|
@@ -32,12 +33,12 @@ export const metadata: Metadata = { | |
openGraph: { | ||
title: 'Stack Auth Dashboard', | ||
description: 'Stack Auth is the open-source Auth0 alternative, and the fastest way to add authentication to your web app.', | ||
images: [`${process.env.NEXT_PUBLIC_STACK_API_URL}/open-graph-image.png`] | ||
images: [`${getPublicEnvVar('NEXT_PUBLIC_STACK_API_URL')}/open-graph-image.png`] | ||
}, | ||
twitter: { | ||
title: 'Stack Auth Dashboard', | ||
description: 'Stack Auth is the open-source Auth0 alternative, and the fastest way to add authentication to your web app.', | ||
images: [`${process.env.NEXT_PUBLIC_STACK_API_URL}/open-graph-image.png`] | ||
images: [`${getPublicEnvVar('NEXT_PUBLIC_STACK_API_URL')}/open-graph-image.png`] | ||
}, | ||
}; | ||
|
||
|
@@ -70,6 +71,7 @@ export default function RootLayout({ | |
return ( | ||
<html suppressHydrationWarning lang="en" className={`${GeistSans.variable} ${GeistMono.variable}`}> | ||
<head> | ||
{getNodeEnvironment() === 'development' && <script src="https://unpkg.com/react-scan/dist/auto.global.js" async />} | ||
<link rel="preconnect" href="https://fonts.gstatic.com" /> | ||
<StyleLink href="https://fonts.googleapis.com/css2?family=Material+Symbols+Rounded&display=block" /> | ||
<StyleLink defer href="https://cdn.jsdelivr.net/npm/[email protected]/dist/katex.css" integrity="sha384-OH8qNTHoMMVNVcKdKewlipV4SErXqccxxlg6HC9Cwjr5oZu2AdBej1TndeCirael" crossOrigin="anonymous" /> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
/* eslint-disable no-restricted-syntax */ | ||
|
||
const _inlineEnvVars = { | ||
NEXT_PUBLIC_STACK_API_URL: process.env.NEXT_PUBLIC_STACK_API_URL, | ||
NEXT_PUBLIC_STACK_DASHBOARD_URL: process.env.NEXT_PUBLIC_STACK_DASHBOARD_URL, | ||
NEXT_PUBLIC_STACK_PROJECT_ID: process.env.NEXT_PUBLIC_STACK_PROJECT_ID, | ||
NEXT_PUBLIC_POSTHOG_KEY: process.env.NEXT_PUBLIC_POSTHOG_KEY, | ||
NEXT_PUBLIC_STACK_SVIX_SERVER_URL: process.env.NEXT_PUBLIC_STACK_SVIX_SERVER_URL, | ||
NEXT_PUBLIC_SENTRY_DSN: process.env.NEXT_PUBLIC_SENTRY_DSN, | ||
NEXT_PUBLIC_VERSION_ALERTER_SEVERE_ONLY: process.env.NEXT_PUBLIC_VERSION_ALERTER_SEVERE_ONLY, | ||
}; | ||
|
||
// This will be replaced with the actual env vars after a docker build | ||
const _postBuildEnvVars = { | ||
NEXT_PUBLIC_STACK_API_URL: "STACK_ENV_VAR_SENTINEL_NEXT_PUBLIC_STACK_API_URL", | ||
NEXT_PUBLIC_STACK_DASHBOARD_URL: "STACK_ENV_VAR_SENTINEL_NEXT_PUBLIC_STACK_DASHBOARD_URL", | ||
NEXT_PUBLIC_STACK_PROJECT_ID: "STACK_ENV_VAR_SENTINEL_NEXT_PUBLIC_STACK_PROJECT_ID", | ||
NEXT_PUBLIC_POSTHOG_KEY: "STACK_ENV_VAR_SENTINEL_NEXT_PUBLIC_POSTHOG_KEY", | ||
NEXT_PUBLIC_STACK_SVIX_SERVER_URL: "STACK_ENV_VAR_SENTINEL_NEXT_PUBLIC_STACK_SVIX_SERVER_URL", | ||
NEXT_PUBLIC_SENTRY_DSN: "STACK_ENV_VAR_SENTINEL_NEXT_PUBLIC_SENTRY_DSN", | ||
NEXT_PUBLIC_VERSION_ALERTER_SEVERE_ONLY: "STACK_ENV_VAR_SENTINEL_NEXT_PUBLIC_VERSION_ALERTER_SEVERE_ONLY", | ||
} satisfies Record<keyof typeof _inlineEnvVars, string>; | ||
|
||
// If this is not replaced with "true", then we will not use inline env vars | ||
const _usePostBuildEnvVars = 'STACK_ENV_VAR_SENTINEL_USE_INLINE_ENV_VARS'; | ||
|
||
export function getPublicEnvVar(name: keyof typeof _inlineEnvVars) { | ||
eval("// this is a hack to force the compiler not to do any smart optimizations"); | ||
if (_usePostBuildEnvVars.slice(0) === 'true') { | ||
const value = _postBuildEnvVars[name]; | ||
if (value.startsWith('STACK_ENV_VAR_SENTINEL')) { | ||
return undefined; | ||
} | ||
return value; | ||
} else { | ||
return _inlineEnvVars[name]; | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters