Skip to content

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

chore: Remove auth email warning for org members (#31043)

Monica Khouryff3522f856d4
diff --git a/apps/studio/components/interfaces/Auth/EmailRateLimitsAlert/EmailRateLimitsAlert.tsx b/apps/studio/components/interfaces/Auth/EmailRateLimitsAlert/EmailRateLimitsAlert.tsx
index 843ce6f9e74..4eb4b01e371 100644
--- a/apps/studio/components/interfaces/Auth/EmailRateLimitsAlert/EmailRateLimitsAlert.tsx
+++ b/apps/studio/components/interfaces/Auth/EmailRateLimitsAlert/EmailRateLimitsAlert.tsx
@@ -1,11 +1,16 @@
import Link from 'next/link'
import { useParams } from 'common'
-import { AlertDescription_Shadcn_, AlertTitle_Shadcn_, Alert_Shadcn_, WarningIcon } from 'ui'
+import {
+ AlertDescription_Shadcn_,
+ AlertTitle_Shadcn_,
+ Alert_Shadcn_,
+ Button,
+ WarningIcon,
+} from 'ui'
export function EmailRateLimitsAlert() {
- const { ref: projectRef } = useParams()
- const after20240926 = Date.now() >= new Date('20240926T00:00:00Z').getTime()
+ const { ref } = useParams()
return (
<Alert_Shadcn_ variant="warning">
@@ -14,30 +19,21 @@ export function EmailRateLimitsAlert() {
<AlertDescription_Shadcn_>
You're using the built-in email service. The service has rate limits and it's not meant to
be used for production apps. Check the{' '}
+ {/* [Refactor] Swap for InlineLink component once https://github.com/supabase/supabase/pull/30494 is in */}
<a
href="https://supabase.com/docs/guides/platform/going-into-prod#auth-rate-limits"
className="underline"
target="_blank"
+ rel="noreferrer noopener"
>
documentation
</a>{' '}
- for an up-to-date information on the current rate limits.{' '}
- <Link
- className="underline"
- target="_blank"
- href={`/project/${projectRef}/settings/auth#auth-config-smtp-form`}
- >
- Set up a custom SMTP server now.
- </Link>
- </AlertDescription_Shadcn_>
- <AlertDescription_Shadcn_ className="mt-2">
- {after20240926
- ? 'To fight abuse, Auth email messages are restricted '
- : 'On 26th September: To fight abuse, Auth email messages will be restricted '}
- to your project's organization members. For example, if your organization has 3 members with
- addresses: <code>[email protected]</code>, <code>[email protected]</code> and{' '}
- <code>[email protected]</code>, messages will be{' '}
- <strong>sent to those addresses only.</strong> Set up custom SMTP to send to any user.
+ for an up-to-date information on the current rate limits.
+ <Button asChild type="default" className="mt-2">
+ <Link target="_blank" href={`/project/${ref}/settings/auth#auth-config-smtp-form`}>
+ Set up custom SMTP server
+ </Link>
+ </Button>
</AlertDescription_Shadcn_>
</Alert_Shadcn_>
)
diff --git a/apps/studio/components/interfaces/Auth/EmailTemplates/EmailTemplates.tsx b/apps/studio/components/interfaces/Auth/EmailTemplates/EmailTemplates.tsx
index 9bced7ff316..80d6ba89f5d 100644
--- a/apps/studio/components/interfaces/Auth/EmailTemplates/EmailTemplates.tsx
+++ b/apps/studio/components/interfaces/Auth/EmailTemplates/EmailTemplates.tsx
@@ -5,7 +5,7 @@ import { FormHeader } from 'components/ui/Forms/FormHeader'
import { FormPanel } from 'components/ui/Forms/FormPanel'
import { GenericSkeletonLoader } from 'components/ui/ShimmeringLoader'
import { useAuthConfigQuery } from 'data/auth/auth-config-query'
-import { Tabs, Tabs_Shadcn_, TabsContent_Shadcn_, TabsList_Shadcn_, TabsTrigger_Shadcn_ } from 'ui'
+import { Tabs_Shadcn_, TabsContent_Shadcn_, TabsList_Shadcn_, TabsTrigger_Shadcn_ } from 'ui'
import { TEMPLATES_SCHEMAS } from '../AuthTemplatesValidation'
import EmailRateLimitsAlert from '../EmailRateLimitsAlert'
import TemplateEditor from './TemplateEditor'
@@ -39,7 +39,11 @@ const EmailTemplates = () => {
{isError && (
<AlertError error={authConfigError} subject="Failed to retrieve auth configuration" />
)}
- {isLoading && <GenericSkeletonLoader />}
+ {isLoading && (
+ <div className="w-[854px]">
+ <GenericSkeletonLoader />
+ </div>
+ )}
{isSuccess && (
<FormPanel>
<Tabs_Shadcn_ defaultValue={TEMPLATES_SCHEMAS[0].title.trim().replace(/\s+/g, '-')}>
diff --git a/apps/studio/components/layouts/ProjectLayout/ProjectLayout.tsx b/apps/studio/components/layouts/ProjectLayout/ProjectLayout.tsx
index c01542b6a4b..594c92f1aee 100644
--- a/apps/studio/components/layouts/ProjectLayout/ProjectLayout.tsx
+++ b/apps/studio/components/layouts/ProjectLayout/ProjectLayout.tsx
@@ -7,7 +7,7 @@ import ProjectAPIDocs from 'components/interfaces/ProjectAPIDocs/ProjectAPIDocs'
import { AIAssistantPanel } from 'components/ui/AIAssistantPanel/AIAssistantPanel'
import AISettingsModal from 'components/ui/AISettingsModal'
import { Loading } from 'components/ui/Loading'
-import ResourceExhaustionWarningBanner from 'components/ui/ResourceExhaustionWarningBanner/ResourceExhaustionWarningBanner'
+import { ResourceExhaustionWarningBanner } from 'components/ui/ResourceExhaustionWarningBanner/ResourceExhaustionWarningBanner'
import { useSelectedOrganization } from 'hooks/misc/useSelectedOrganization'
import { useSelectedProject } from 'hooks/misc/useSelectedProject'
import { withAuth } from 'hooks/misc/withAuth'
diff --git a/apps/studio/components/ui/ResourceExhaustionWarningBanner/ResourceExhaustionWarningBanner.constants.ts b/apps/studio/components/ui/ResourceExhaustionWarningBanner/ResourceExhaustionWarningBanner.constants.ts
index fc10cb76512..e1fe17b52da 100644
--- a/apps/studio/components/ui/ResourceExhaustionWarningBanner/ResourceExhaustionWarningBanner.constants.ts
+++ b/apps/studio/components/ui/ResourceExhaustionWarningBanner/ResourceExhaustionWarningBanner.constants.ts
@@ -5,7 +5,6 @@ interface ResourceWarningMessage {
bannerContent: {
warning: { title: string; description: string }
critical: { title?: string; description?: string }
- allowDismissable?: boolean
}
cardContent: {
warning: { title: string; description: string }
@@ -213,36 +212,4 @@ export const RESOURCE_WARNING_MESSAGES: Record<string, ResourceWarningMessage> =
buttonText: 'Check usage',
metric: null,
},
- // [Joshen] We can remove this once auth team gives the signal to
- auth_restricted_email_sending: {
- restrictToRoutes: ['/project/[ref]/auth', '/project/[ref]/settings/auth'], // project home, auth, settings
- bannerContent: {
- warning: {
- title: "Authentication emails are only sent to organization members' email addresses",
- description:
- 'Set up a custom SMTP provider to handle flows like password reset which require sending emails to any user',
- },
- critical: {
- title: "Authentication emails are only sent to organization members' email addresses",
- description:
- 'Set up a custom SMTP provider to handle flows like password reset which require sending emails to any user',
- },
- allowDismissable: true,
- },
- cardContent: {
- warning: {
- title: 'Auth emails are restricted',
- description:
- "Your project can only send Auth emails to your organization's members. Set up a custom SMTP provider to send Auth emails to any user",
- },
- critical: {
- title: 'Auth emails are restricted',
- description:
- "Your project can only send Auth emails to your organization's members. Set up a custom SMTP provider to send Auth emails to any user.",
- },
- },
- docsUrl: 'https://github.com/orgs/supabase/discussions/29370',
- buttonText: 'Set up custom SMTP now',
- metric: 'auth_restricted_email_sending',
- },
}
diff --git a/apps/studio/components/ui/ResourceExhaustionWarningBanner/ResourceExhaustionWarningBanner.tsx b/apps/studio/components/ui/ResourceExhaustionWarningBanner/ResourceExhaustionWarningBanner.tsx
index bf79befa704..583872abb20 100644
--- a/apps/studio/components/ui/ResourceExhaustionWarningBanner/ResourceExhaustionWarningBanner.tsx
+++ b/apps/studio/components/ui/ResourceExhaustionWarningBanner/ResourceExhaustionWarningBanner.tsx
@@ -1,4 +1,4 @@
-import { AlertTriangle, ExternalLink, X } from 'lucide-react'
+import { AlertTriangle, ExternalLink } from 'lucide-react'
import Link from 'next/link'
import { useRouter } from 'next/router'
@@ -7,10 +7,8 @@ import { useResourceWarningsQuery } from 'data/usage/resource-warnings-query'
import { AlertDescription_Shadcn_, AlertTitle_Shadcn_, Alert_Shadcn_, Button, cn } from 'ui'
import { RESOURCE_WARNING_MESSAGES } from './ResourceExhaustionWarningBanner.constants'
import { getWarningContent } from './ResourceExhaustionWarningBanner.utils'
-import { useLocalStorageQuery } from 'hooks/misc/useLocalStorage'
-import { LOCAL_STORAGE_KEYS } from 'lib/constants'
-const ResourceExhaustionWarningBanner = () => {
+export const ResourceExhaustionWarningBanner = () => {
const { ref } = useParams()
const router = useRouter()
const { data: resourceWarnings } = useResourceWarningsQuery()
@@ -18,11 +16,6 @@ const ResourceExhaustionWarningBanner = () => {
(warning) => warning.project === ref
)
- const [bannerAcknowledged, setBannerAcknowledged] = useLocalStorageQuery(
- LOCAL_STORAGE_KEYS.AUTH_EMAIL_WARNING_BANNER_ACKNOWLEDGE(ref ?? ''),
- false
- )
-
// [Joshen] Read only takes higher precedence over multiple resource warnings
const activeWarnings =
projectResourceWarnings !== undefined
@@ -85,10 +78,6 @@ const ResourceExhaustionWarningBanner = () => {
default: (metric: string) => `/project/[ref]/settings/[infra-path]#${metric}`,
}
- const isDismissable =
- RESOURCE_WARNING_MESSAGES[metric as keyof typeof RESOURCE_WARNING_MESSAGES]?.bannerContent
- .allowDismissable ?? false
-
const getCorrectionUrl = (metric: string | undefined | null) => {
const variant = metric === undefined ? 'undefined' : metric === null ? 'null' : metric
const url =
@@ -137,21 +126,12 @@ const ResourceExhaustionWarningBanner = () => {
return isMatch
})
- // [Joshen] Only certain warnings should be dismissable, in this case for now,
- // only the auth email banner should be, everything else should not be dismissable
- const dismissBanner = () => {
- setBannerAcknowledged(true)
- }
-
if (
hasNoWarnings ||
hasNoWarningContent ||
onUsageOrInfraAndNotInReadOnlyMode ||
onDatabaseSettingsAndInReadOnlyMode ||
- !isVisible ||
- (router.pathname.includes('/auth/') &&
- !!projectResourceWarnings?.auth_restricted_email_sending &&
- bannerAcknowledged)
+ !isVisible
) {
return null
}
@@ -182,19 +162,7 @@ const ResourceExhaustionWarningBanner = () => {
<Link href={correctionUrl}>{buttonText ?? 'Check'}</Link>
</Button>
)}
- {isDismissable && (
- <Button
- type="text"
- icon={<X />}
- className="px-1.5 !space-x-0"
- onClick={() => dismissBanner()}
- >
- <span className="sr-only">Close</span>
- </Button>
- )}
</div>
</Alert_Shadcn_>
)
}
-
-export default ResourceExhaustionWarningBanner
diff --git a/apps/studio/lib/constants/index.ts b/apps/studio/lib/constants/index.ts
index 874cda2f4b2..b43f1305c8f 100644
--- a/apps/studio/lib/constants/index.ts
+++ b/apps/studio/lib/constants/index.ts
@@ -73,8 +73,6 @@ export const LOCAL_STORAGE_KEYS = {
AUTH_SMTP_CHANGES_WARNING: 'auth-smtp-changes-warning-dismissed',
AUTH_USERS_COLUMNS_CONFIGURATION: (ref: string) => `supabase-auth-users-columns-${ref}`,
- AUTH_EMAIL_WARNING_BANNER_ACKNOWLEDGE: (ref: string) =>
- `supabase-auth-email-warning-banner-${ref}`,
}
export const OPT_IN_TAGS = {