ConusAI vendor v0.1.0-dev.20261027+9b1131fb
ci / gate (push) Waiting to run

This commit is contained in:
ConusAI vendor v0.1.0-dev.20261027+9b1131fb
2026-10-27 18:05:17 +00:00
commit 3102273ec7
538 changed files with 80203 additions and 0 deletions
+42
View File
@@ -0,0 +1,42 @@
// SPDX-License-Identifier: LicenseRef-ConusAI-Template-1.0
// The sign-up page of the Convex Better Auth adapter (AUTH_PROVIDER=convex-better-auth): a new
// account with an e-mail address and a password. An OIDC deployment has its identity provider's own
// registration, so this page is not found there.
import { loadAuthConfig } from "@conusai-kit/auth"
import { notFound, redirect } from "next/navigation"
import type { ReactElement } from "react"
import { safeReturnTo } from "../../../src/server/auth-errors"
import { betterAuthFormLabels, MIN_PASSWORD_LENGTH } from "../../../src/server/better-auth"
import { pageContext } from "../../../src/server/page"
import { BetterAuthForm } from "../../../src/ui/better-auth-form"
import { StateView } from "../../../src/ui/state-view"
export const dynamic = "force-dynamic"
export default async function SignUp({
searchParams,
}: {
searchParams: Promise<{ return_to?: string }>
}): Promise<ReactElement> {
if (loadAuthConfig().provider !== "convex-better-auth") notFound()
const { return_to: returnToParam } = await searchParams
const { i18n, signedIn } = await pageContext()
const returnTo = safeReturnTo(returnToParam)
if (signedIn) redirect(returnTo)
const next = returnTo === "/" ? "" : `?return_to=${encodeURIComponent(returnTo)}`
return (
<StateView title={i18n.message("signin.account.signUpTitle")}>
<p>{i18n.message("signin.account.signUpIntro")}</p>
<BetterAuthForm
mode="sign-up"
returnTo={returnTo}
minPasswordLength={MIN_PASSWORD_LENGTH}
labels={betterAuthFormLabels(i18n, "sign-up")}
/>
<p>
<a href={`/auth/sign-in${next}`}>{i18n.message("signin.account.toSignIn")}</a>
</p>
</StateView>
)
}