Skip to content

The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.

chore: add MFA contact form

Jonathan Summers-Muirf9bace22658a
diff --git a/apps/www/components/MfaContactForm.tsx b/apps/www/components/MfaContactForm.tsx
new file mode 100644
index 00000000000..704e36ca6ac
--- /dev/null
+++ b/apps/www/components/MfaContactForm.tsx
@@ -0,0 +1,182 @@
+import { Button, Form, Input, Select } from '@supabase/ui'
+import { useState } from 'react'
+import countries from '~/data/Countries.json'
+import supabase from '~/lib/supabase'
+
+const INITIAL_VALUES = {
+ companyName: '',
+ contactFirstName: '',
+ contactLastName: '',
+ contactEmail: '',
+ contactPhone: '',
+ companySize: '',
+ details: '',
+ country: 'US',
+}
+
+const validate = (values: any) => {
+ const errors: any = {}
+
+ if (!values.companyName) {
+ errors.companyName = 'Required'
+ }
+
+ if (!values.contactFirstName) {
+ errors.contactFirstName = 'Required'
+ }
+
+ if (!values.contactLastName) {
+ errors.contactLastName = 'Required'
+ }
+
+ if (!values.contactEmail) {
+ errors.contactEmail = 'Required'
+ } else if (!/^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,}$/i.test(values.contactEmail)) {
+ errors.contactEmail = 'Invalid email address'
+ }
+
+ return errors
+}
+
+const MfaContactForm = () => {
+ const [formSubmitted, setFormSubmitted] = useState<boolean>(false)
+
+ const handleFormSubmit = async (values: typeof INITIAL_VALUES, { resetForm }: any) => {
+ const { error } = await supabase.from('mfa_early_access_contacts').insert(
+ [
+ {
+ company_name: values.companyName,
+ contact_name: `${values.contactFirstName} ${values.contactLastName}`,
+ contact_first_name: values.contactFirstName,
+ contact_last_name: values.contactLastName,
+ contact_email: values.contactEmail,
+ contact_phone: values.contactPhone,
+ company_size: values.companySize,
+ details: values.details,
+ country: values.country,
+ },
+ ],
+ { returning: 'minimal' }
+ )
+
+ // TODO: handle error
+ console.log('error:', error)
+ if (!error) {
+ resetForm()
+
+ setFormSubmitted(true)
+ }
+ }
+
+ return (
+ <div>
+ <Form initialValues={INITIAL_VALUES} validate={validate} onSubmit={handleFormSubmit}>
+ {({ isSubmitting }: any) => (
+ <div className="flex flex-col space-y-4">
+ <div>
+ <Input
+ label="Company Name *"
+ id="companyName"
+ name="companyName"
+ layout="vertical"
+ placeholder="Supa Inc."
+ />
+ </div>
+
+ <div className="flex space-x-4">
+ <div className="flex-1">
+ <Input
+ label="Your First Name *"
+ id="contactFirstName"
+ name="contactFirstName"
+ layout="vertical"
+ placeholder="Jane"
+ />
+ </div>
+
+ <div className="flex-1">
+ <Input
+ label="Your Last Name *"
+ id="contactLastName"
+ name="contactLastName"
+ layout="vertical"
+ placeholder="Doe"
+ />
+ </div>
+ </div>
+
+ <div>
+ <Input
+ label="Your Business Email *"
+ id="contactEmail"
+ name="contactEmail"
+ layout="vertical"
+ placeholder="[email protected]"
+ />
+ </div>
+
+ <div>
+ <Select label="Company Size" id="companySize" name="companySize" layout="vertical">
+ <Select.Option value="">{'--'}</Select.Option>
+ <Select.Option value="1-10">1-10 Employees</Select.Option>
+ <Select.Option value="11-50">11-50 Employees</Select.Option>
+ <Select.Option value="51-200">51-200 Employees</Select.Option>
+ <Select.Option value="201-500">201-500 Employees</Select.Option>
+ <Select.Option value="501-1000">501-1000 Employees</Select.Option>
+ <Select.Option value="1001-5000">1001-5000 Employees</Select.Option>
+ <Select.Option value="5001+">5001+ Employees</Select.Option>
+ </Select>
+ </div>
+
+ <div>
+ <Input
+ label="Your Phone Number"
+ id="contactPhone"
+ name="contactPhone"
+ layout="vertical"
+ placeholder="+65 1234 1234"
+ />
+ </div>
+
+ <div>
+ <Select label="Country / Main Timezone" id="country" name="country" layout="vertical">
+ {countries.map(({ code, name }) => (
+ <Select.Option key={code} value={code}>
+ {name}
+ </Select.Option>
+ ))}
+ </Select>
+ </div>
+
+ <div className="">
+ <Input.TextArea
+ id="details"
+ name="details"
+ label="Additional Details"
+ placeholder="Tell us about your projects, clients, and technology..."
+ rows={10}
+ />
+ </div>
+
+ <div className="col-span-2 flex w-full flex-row-reverse pt-4">
+ <Button
+ size="xlarge"
+ disabled={isSubmitting}
+ loading={isSubmitting}
+ htmlType="submit"
+ >
+ Send
+ </Button>
+ </div>
+ </div>
+ )}
+ </Form>
+
+ {formSubmitted && (
+ <h3 className="h3 mt-12 text-center">Thanks, we'll reach out to you shortly.</h3>
+ )}
+ </div>
+ )
+}
+
+export default MfaContactForm
diff --git a/apps/www/pages/auth/Auth.tsx b/apps/www/pages/auth/Auth.tsx
index 654866101da..96070c357cf 100644
--- a/apps/www/pages/auth/Auth.tsx
+++ b/apps/www/pages/auth/Auth.tsx
@@ -196,6 +196,14 @@ function AuthPage() {
text="Request additional user data permissions when using social logins."
/>
</div>
+ <div className="col-span-12 sm:col-span-6 lg:col-span-12 xl:col-span-4">
+ <FeatureColumn
+ icon={<IconBriefcase />}
+ title="MFA"
+ text="Support for SAML, Azure. More enterprise providers and SSO coming soon."
+ />
+ <Button>Get early access</Button>
+ </div>
</div>,
]}
documentation_link={'/docs/guides/auth'}
@@ -249,62 +257,6 @@ function AuthPage() {
<AuthWidgetSection />
- {/* <SectionContainer>
- <div className="grid grid-cols-12 lg:gap-16">
- <div className="order-last col-span-12 mt-8 lg:order-first lg:col-span-6 lg:mt-0">
- <AuthComponentExample />
- </div>
- <div className="col-span-12 lg:col-span-6 lg:col-start-7 xl:col-span-4 xl:col-start-8">
- <div className="mb-4 flex items-center space-x-2">
- <div className="flex h-8 w-8 items-center justify-center rounded-md bg-gray-900 text-white dark:bg-white dark:text-gray-900">
- <ProductIcon icon={Solutions['authentication'].icon} />
- </div>
- <p className="m-0">
- <IconX />
- </p>
- <img className="w-8" src={`${basePath}/images/product/auth/react-icon.svg`} />
- </div>
-
- <h2 className="h3">React Auth</h2>
-
- <p className="p text-base lg:text-lg">
- Pre-built auth widgets to get started in minutes.
- </p>
- <p className="p">
- Supabase provides React libraries which handle common scenarios, including logging
- in, signing up, magic link and forgot password forms.
- </p>
-
- <Link
- href="https://github.com/supabase/ui#using-supabase-ui-auth"
- as="https://github.com/supabase/ui#using-supabase-ui-auth"
- >
- <a>
- <Button size="small" type="default" className="mt-4" icon={<IconArrowUpRight />}>
- Explore documentation
- </Button>
- </a>
- </Link>
-
- <div className="mt-8 grid grid-cols-12 md:gap-8 lg:gap-0 xl:gap-16">
- <div className="col-span-12 lg:col-span-12 xl:col-span-4">
- <FeatureColumn
- icon={<IconBriefcase />}
- title="Social login support"
- text="Support for social logins are built in and the component "
- />
- </div>
- <div className="col-span-12 lg:col-span-12 xl:col-span-4">
- <FeatureColumn
- icon={<IconEye />}
- title="User context hooks"
- text="Access the auth status from any component."
- />
- </div>
- </div>
- </div>
- </div>
- </SectionContainer> */}
<CTABanner />
</DefaultLayout>
</>
diff --git a/apps/www/pages/contact/mfa.tsx b/apps/www/pages/contact/mfa.tsx
new file mode 100644
index 00000000000..da713806482
--- /dev/null
+++ b/apps/www/pages/contact/mfa.tsx
@@ -0,0 +1,38 @@
+import { NextSeo } from 'next-seo'
+import { useRouter } from 'next/router'
+import DefaultLayout from '~/components/Layouts/Default'
+import MfaContactForm from '~/components/MFAContactForm'
+
+const meta_title = 'MFA early access | Supabase'
+const meta_description = ''
+
+const EnterpriseContactPage = () => {
+ const router = useRouter()
+
+ return (
+ <DefaultLayout>
+ <NextSeo
+ title={meta_title}
+ description={meta_description}
+ openGraph={{
+ title: meta_title,
+ description: meta_description,
+ url: `https://supabase.com/${router.pathname}`,
+ images: [
+ {
+ url: `https://supabase.com/images/og/og-image.jpg`,
+ },
+ ],
+ }}
+ />
+
+ <div className="mx-auto my-16 max-w-xl px-4 md:my-20 lg:my-24 xl:my-32">
+ <h2 className="h2 block pb-16 text-center">MFA Early access</h2>
+
+ <MfaContactForm />
+ </div>
+ </DefaultLayout>
+ )
+}
+
+export default EnterpriseContactPage