Files
supabase/apps/studio/components/interfaces/Auth/AuthProvidersForm/AuthAlert.tsx
Alaister Young 5f533247e1 Update docs url to env var (#38772)
* Update Supabase docs URLs to use env variable

Co-authored-by: a <a@alaisteryoung.com>

* Refactor: Use DOCS_URL constant for documentation links

This change centralizes documentation links using a new DOCS_URL constant, improving maintainability and consistency.

Co-authored-by: a <a@alaisteryoung.com>

* Refactor: Use DOCS_URL constant for all documentation links

This change replaces hardcoded documentation URLs with a centralized constant, improving maintainability and consistency.

Co-authored-by: a <a@alaisteryoung.com>

* replace more instances

* ci: Autofix updates from GitHub workflow

* remaining instances

* fix duplicate useRouter

---------

Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: alaister <10985857+alaister@users.noreply.github.com>
2025-09-26 10:16:33 +00:00

66 lines
2.0 KiB
TypeScript

import { ExternalLink } from 'lucide-react'
import Link from 'next/link'
import { useParams } from 'common'
import { DOCS_URL } from 'lib/constants'
import {
Alert_Shadcn_,
AlertDescription_Shadcn_,
AlertTitle_Shadcn_,
Button,
WarningIcon,
} from 'ui'
export const AuthAlert = ({
title,
isHookSendSMSEnabled,
}: {
title: string
isHookSendSMSEnabled: boolean
}) => {
const { ref } = useParams()
switch (title) {
// TODO (KM): Remove after 10th October 2024 when we disable the provider
case 'Slack (Deprecated)':
return (
<Alert_Shadcn_ variant="warning">
<WarningIcon />
<AlertTitle_Shadcn_>Slack (Deprecated) Provider</AlertTitle_Shadcn_>
<AlertDescription_Shadcn_>
Recently, Slack has updated their OAuth API. Please use the new Slack (OIDC) provider
below. Developers using this provider should move over to the new provider. Please refer
to our{' '}
<a
href={`${DOCS_URL}/guides/auth/social-login/auth-slack`}
className="underline"
target="_blank"
>
documentation
</a>{' '}
for more details.
</AlertDescription_Shadcn_>
</Alert_Shadcn_>
)
case 'Phone':
return (
isHookSendSMSEnabled && (
<Alert_Shadcn_>
<WarningIcon />
<AlertTitle_Shadcn_>
SMS provider settings are disabled while the SMS hook is enabled.
</AlertTitle_Shadcn_>
<AlertDescription_Shadcn_ className="flex flex-col gap-y-3">
<p>The SMS hook will be used in place of the SMS provider configured</p>
<Button asChild type="default" className="w-min" icon={<ExternalLink />}>
<Link href={`/project/${ref}/auth/hooks`}>View auth hooks</Link>
</Button>
</AlertDescription_Shadcn_>
</Alert_Shadcn_>
)
)
default:
return null
}
}