fix(web): use internal Convex URL on server-rendered auth pages
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
2fab586d17
commit
b5507d3f81
3 files changed
+15
-2
No files matched your search
@@ -1,11 +1,16 @@
|
||||
import { fetchQuery } from "convex/nextjs"
|
||||
import { connection } from "next/server"
|
||||
import { AuthForm } from "@/components/auth-form"
|
||||
import { convexServerOptions } from "@/lib/convex-server"
|
||||
import { api } from "@otunes/convex/_generated/api"
|
||||
|
||||
export default async function SignInPage() {
|
||||
await connection()
|
||||
const { disableAccountCreation } = await fetchQuery(api.users.getAppSettings)
|
||||
const { disableAccountCreation } = await fetchQuery(
|
||||
api.users.getAppSettings,
|
||||
{},
|
||||
convexServerOptions()
|
||||
)
|
||||
|
||||
return (
|
||||
<AuthForm flow="signIn" accountCreationDisabled={disableAccountCreation} />
|
||||
|
||||
@@ -1,11 +1,16 @@
|
||||
import { fetchQuery } from "convex/nextjs"
|
||||
import { connection } from "next/server"
|
||||
import { AuthForm } from "@/components/auth-form"
|
||||
import { convexServerOptions } from "@/lib/convex-server"
|
||||
import { api } from "@otunes/convex/_generated/api"
|
||||
|
||||
export default async function SignUpPage() {
|
||||
await connection()
|
||||
const { disableAccountCreation } = await fetchQuery(api.users.getAppSettings)
|
||||
const { disableAccountCreation } = await fetchQuery(
|
||||
api.users.getAppSettings,
|
||||
{},
|
||||
convexServerOptions()
|
||||
)
|
||||
|
||||
return (
|
||||
<AuthForm flow="signUp" accountCreationDisabled={disableAccountCreation} />
|
||||
|
||||
@@ -97,6 +97,9 @@ log "Starting web server"
|
||||
cd /app
|
||||
export HOME=/app NODE_ENV=production PORT=3000 HOSTNAME=0.0.0.0
|
||||
export CONVEX_INTERNAL_URL="$BACKEND_URL"
|
||||
# Server-side Convex helpers fall back to this at runtime. The browser bundle
|
||||
# is built without it, so browsers still derive their own URL.
|
||||
export NEXT_PUBLIC_CONVEX_URL="$BACKEND_URL"
|
||||
exec setpriv --reuid=otunes --regid=otunes --init-groups \
|
||||
"$NODE" apps/web/server.js
|
||||
) &
|
||||
|
||||
Reference in new issue
Block a user