Skip to content

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

chore: remove unnecessary mfa page (#22253)

Kevin Grüneberg99e676b0a556
diff --git a/apps/www/components/MfaContactForm.tsx b/apps/www/components/MfaContactForm.tsx
deleted file mode 100644
index b3ae07406ca..00000000000
--- a/apps/www/components/MfaContactForm.tsx
+++ /dev/null
@@ -1,179 +0,0 @@
-import { Button, Form, Input, Select } from 'ui'
-import { useState } from 'react'
-import countries from '~/data/Countries.json'
-import supabase from '~/lib/supabaseMisc'
-
-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,
- },
- ])
-
- // 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>
- <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/components/SOC2RequestForm.tsx b/apps/www/components/SOC2RequestForm.tsx
deleted file mode 100644
index aab3fca7c95..00000000000
--- a/apps/www/components/SOC2RequestForm.tsx
+++ /dev/null
@@ -1,205 +0,0 @@
-import { Button, Form, Input, Select } from 'ui'
-import { useState } from 'react'
-import countries from '~/data/Countries.json'
-import supabase from '~/lib/supabaseMisc'
-
-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 SOC2RequestForm = () => {
- const [error, setError] = useState<string>()
- const [formSubmitted, setFormSubmitted] = useState<boolean>(false)
-
- const handleFormSubmit = async (values: typeof INITIAL_VALUES, { resetForm }: any) => {
- const { error } = await supabase.from('soc2_requests').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,
- },
- ])
-
- if (!error) {
- resetForm()
- setFormSubmitted(true)
- } else {
- setError(error.message)
- }
- }
-
- return (
- <div>
- {formSubmitted ? (
- <h3 className="h3 text-brand mt-12 text-center">
- Thank you for your submission! A member from the Supabase team will reach out to you
- shortly!
- </h3>
- ) : (
- <>
- <Form initialValues={INITIAL_VALUES} validate={validate} onSubmit={handleFormSubmit}>
- {({ values, isSubmitting }: any) => {
- const selectedCountry = countries.find(
- (country) => country.code === values['country']
- )
- const phonePlaceholder =
- selectedCountry !== undefined ? `+${selectedCountry.phone_code}` : ''
-
- return (
- <div className="flex flex-col space-y-1">
- <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>
- <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>
- <Input
- label="Your Phone Number"
- id="contactPhone"
- name="contactPhone"
- layout="vertical"
- placeholder={phonePlaceholder}
- />
- </div>
-
- <div>
- <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
- type="primary"
- size="small"
- className="text-white"
- htmlType="submit"
- disabled={isSubmitting}
- loading={isSubmitting}
- >
- Submit request
- </Button>
- </div>
- </div>
- )
- }}
- </Form>
- {error && <p className="text-sm">Error: {error}</p>}
- </>
- )}
- </div>
- )
-}
-
-export default SOC2RequestForm
diff --git a/apps/www/lib/redirects.js b/apps/www/lib/redirects.js
index d1999afa167..f05641e3d90 100644
--- a/apps/www/lib/redirects.js
+++ b/apps/www/lib/redirects.js
@@ -2403,4 +2403,9 @@ module.exports = [
source: '/docs/guides/auth/sso/auth-sso-saml',
destination: '/guides/auth/enterprise-sso/auth-sso-saml',
},
+ {
+ permanent: true,
+ source: '/contact/mfa',
+ destination: '/docs/guides/auth/auth-mfa',
+ },
]
diff --git a/apps/www/pages/contact/mfa.tsx b/apps/www/pages/contact/mfa.tsx
deleted file mode 100644
index 17cdae433e9..00000000000
--- a/apps/www/pages/contact/mfa.tsx
+++ /dev/null
@@ -1,38 +0,0 @@
-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-v2.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