import { Or } from '@/components/auth/or'; import { SignInGithub } from '@/components/auth/sign-in-github'; import { SignInGoogle } from '@/components/auth/sign-in-google'; import { SignUpEmailForm } from '@/components/auth/sign-up-email-form'; import FullPageLoadingState from '@/components/full-page-loading-state'; import { LogoSquare } from '@/components/logo'; import { useTRPC } from '@/integrations/trpc/react'; import { PAGE_TITLES, createEntityTitle } from '@/utils/title'; import { useQuery } from '@tanstack/react-query'; import { createFileRoute, redirect } from '@tanstack/react-router'; import { motion } from 'framer-motion'; import { MailIcon } from 'lucide-react'; import { z } from 'zod'; const validateSearch = z.object({ inviteId: z.string().optional(), }); export const Route = createFileRoute('/_public/onboarding')({ head: () => ({ meta: [ { title: createEntityTitle('Create an account', PAGE_TITLES.ONBOARDING) }, { name: 'robots', content: 'noindex, follow' }, ], }), beforeLoad: async ({ context }) => { if (context.session.session) { throw redirect({ to: '/' }); } }, component: Component, validateSearch, loader: async ({ context, location }) => { const search = validateSearch.safeParse(location.search); if (search.success && search.data.inviteId) { await context.queryClient.prefetchQuery( context.trpc.organization.getInvite.queryOptions({ inviteId: search.data.inviteId, }), ); } }, pendingComponent: FullPageLoadingState, }); function Component() { const { inviteId } = Route.useSearch(); const trpc = useTRPC(); const { data: invite } = useQuery( trpc.organization.getInvite.queryOptions( { inviteId: inviteId, }, { enabled: !!inviteId, }, ), ); return (

Create an account

Let's start with creating your account. By creating an account you accept the{' '} Terms of Service {' '} and{' '} Privacy Policy .

{invite && !invite.isExpired && (

Invitation to {invite.organization?.name}

After you have created your account, you will be added to the organization.

)} {invite?.isExpired && (

Invitation to {invite.organization?.name} has expired

The invitation has expired. Please contact the organization owner to get a new invitation.

)}
Sign up with email
); }