Skip to content

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

[FE-4185] feat(studio): custom content key for auth page logo link (#49130)

Alaister Youngb044408e79cc
diff --git a/apps/studio/components/layouts/SignInLayout/ForgotPasswordLayout.tsx b/apps/studio/components/layouts/SignInLayout/ForgotPasswordLayout.tsx
index c7b24a8d3b2..2b0824e92df 100644
--- a/apps/studio/components/layouts/SignInLayout/ForgotPasswordLayout.tsx
+++ b/apps/studio/components/layouts/SignInLayout/ForgotPasswordLayout.tsx
@@ -4,6 +4,7 @@ import Link from 'next/link'
import { PropsWithChildren, useEffect, useState } from 'react'
import { cn } from 'ui'
+import { useCustomContent } from '@/hooks/custom-content/useCustomContent'
import { BASE_PATH } from '@/lib/constants'
type ForgotPasswordLayoutProps = {
@@ -23,6 +24,8 @@ export const ForgotPasswordLayout = ({
children,
}: PropsWithChildren<ForgotPasswordLayoutProps>) => {
const { resolvedTheme } = useTheme()
+ const { dashboardAuthLogoLinkUrl } = useCustomContent(['dashboard_auth:logo_link_url'])
+ const marketingSiteUrl = dashboardAuthLogoLinkUrl ?? 'https://supabase.com'
// Addresses hydration issue with `resolvedTheme` as its undefined during SSR and the first (hydrating) client render
const [mounted, setMounted] = useState(false)
@@ -39,7 +42,7 @@ export const ForgotPasswordLayout = ({
<nav className="relative flex items-center justify-between sm:h-10">
<div className="flex shrink-0 grow items-center lg:grow-0">
<div className="flex w-full items-center justify-between md:w-auto">
- <Link href={logoLinkToMarketingSite ? 'https://supabase.com' : '/organizations'}>
+ <Link href={logoLinkToMarketingSite ? marketingSiteUrl : '/organizations'}>
<Image
src={
mounted && resolvedTheme?.includes('dark')
diff --git a/apps/studio/components/layouts/SignInLayout/SignInLayout.tsx b/apps/studio/components/layouts/SignInLayout/SignInLayout.tsx
index fd12b00e6ac..127e58a1e5f 100644
--- a/apps/studio/components/layouts/SignInLayout/SignInLayout.tsx
+++ b/apps/studio/components/layouts/SignInLayout/SignInLayout.tsx
@@ -16,6 +16,7 @@ import {
import { DocsButton } from '@/components/ui/DocsButton'
import { InlineLink } from '@/components/ui/InlineLink'
import { IdentityProviderIcon } from '@/components/ui/ProviderIcon'
+import { useCustomContent } from '@/hooks/custom-content/useCustomContent'
import { useInboundBranding } from '@/hooks/misc/useInboundBranding'
import { useIsFeatureEnabled } from '@/hooks/misc/useIsFeatureEnabled'
import { BASE_PATH, DOCS_URL } from '@/lib/constants'
@@ -65,6 +66,8 @@ export const SignInLayout = ({
const ongoingIncident = useFlag('ongoingIncident')
const { destination, focusProvider } = useInboundBranding(inboundFlow)
+ const { dashboardAuthLogoLinkUrl } = useCustomContent(['dashboard_auth:logo_link_url'])
+ const marketingSiteUrl = dashboardAuthLogoLinkUrl ?? 'https://supabase.com'
// Addresses hydration issue with `resolvedTheme` as its undefined during SSR and the first (hydrating) client render
const [mounted, setMounted] = useState(false)
@@ -204,7 +207,7 @@ export const SignInLayout = ({
<nav className="relative flex items-center justify-between sm:h-10">
<div className="flex items-center grow shrink-0 lg:grow-0">
<div className="flex items-center justify-between w-full md:w-auto">
- <Link href={logoLinkToMarketingSite ? 'https://supabase.com' : '/organizations'}>
+ <Link href={logoLinkToMarketingSite ? marketingSiteUrl : '/organizations'}>
<img
src={
mounted && resolvedTheme?.includes('dark')
diff --git a/apps/studio/hooks/custom-content/CustomContent.types.ts b/apps/studio/hooks/custom-content/CustomContent.types.ts
index d965508912d..f8ac5f665f6 100644
--- a/apps/studio/hooks/custom-content/CustomContent.types.ts
+++ b/apps/studio/hooks/custom-content/CustomContent.types.ts
@@ -7,6 +7,8 @@ export type CustomContentTypes = {
dashboardAuthCustomProviders: string[]
+ dashboardAuthLogoLinkUrl: string
+
docsRowLevelSecurityGuidePath: string
organizationLegalDocuments: {
diff --git a/apps/studio/hooks/custom-content/custom-content.json b/apps/studio/hooks/custom-content/custom-content.json
index a3ffff7d1d0..0f094e3788c 100644
--- a/apps/studio/hooks/custom-content/custom-content.json
+++ b/apps/studio/hooks/custom-content/custom-content.json
@@ -7,6 +7,8 @@
"dashboard_auth:custom_providers": null,
+ "dashboard_auth:logo_link_url": null,
+
"docs:row_level_security_guide_path": "/guides/auth/row-level-security",
"organization:legal_documents": null,
diff --git a/apps/studio/hooks/custom-content/custom-content.sample.json b/apps/studio/hooks/custom-content/custom-content.sample.json
index 23ac2df49b5..1fcc2e6a810 100644
--- a/apps/studio/hooks/custom-content/custom-content.sample.json
+++ b/apps/studio/hooks/custom-content/custom-content.sample.json
@@ -7,6 +7,8 @@
"dashboard_auth:custom_providers": ["Nimbus"],
+ "dashboard_auth:logo_link_url": "https://example.com",
+
"docs:row_level_security_guide_path": "/guides/database/postgres/row-level-security",
"organization:legal_documents": [
diff --git a/apps/studio/hooks/custom-content/custom-content.schema.json b/apps/studio/hooks/custom-content/custom-content.schema.json
index 3fed50e746c..508f26527b4 100644
--- a/apps/studio/hooks/custom-content/custom-content.schema.json
+++ b/apps/studio/hooks/custom-content/custom-content.schema.json
@@ -24,6 +24,11 @@
}
},
+ "dashboard_auth:logo_link_url": {
+ "type": ["string", "null"],
+ "description": "The URL for the logo on the auth pages (sign in, forgot password, etc.) links to. Defaults to https://supabase.com"
+ },
+
"docs:row_level_security_guide_path": {
"type": ["string"],
"description": "The path to the row level security guide in the docs"