mirror of
https://github.com/supabase/supabase.git
synced 2026-10-08 10:55:06 +03:00
Merge pull request #15122 from supabase/chore/add-custom-domain-to-auth-providers
Use custom domain in provider list, if we have one
This commit is contained in:
1 file changed
+10
-2
@@ -9,6 +9,8 @@ import { BASE_PATH } from 'lib/constants'
|
||||
import { Provider } from './AuthProvidersForm.types'
|
||||
import { ProviderCollapsibleClasses } from './AuthProvidersForm.constants'
|
||||
import FormField from './FormField'
|
||||
import { useCustomDomainsQuery } from 'data/custom-domains/custom-domains-query'
|
||||
import { useParams } from 'common'
|
||||
|
||||
interface Props {
|
||||
provider: Provider
|
||||
@@ -17,10 +19,12 @@ interface Props {
|
||||
const ProviderForm: FC<Props> = ({ provider }) => {
|
||||
const [open, setOpen] = useState(false)
|
||||
const { authConfig, ui } = useStore()
|
||||
|
||||
const { ref } = useParams()
|
||||
const doubleNegativeKeys = ['MAILER_AUTOCONFIRM', 'SMS_AUTOCONFIRM']
|
||||
const canUpdateConfig = checkPermissions(PermissionAction.UPDATE, 'custom_config_gotrue')
|
||||
|
||||
const { data: customDomainData } = useCustomDomainsQuery({ projectRef: ref })
|
||||
|
||||
const generateInitialValues = () => {
|
||||
const initialValues: { [x: string]: string } = {}
|
||||
Object.keys(provider.properties).forEach((key) => {
|
||||
@@ -153,7 +157,11 @@ const ProviderForm: FC<Props> = ({ provider }) => {
|
||||
readOnly
|
||||
disabled
|
||||
label="Redirect URL"
|
||||
value={`https://${ui.selectedProjectRef}.supabase.co/auth/v1/callback`}
|
||||
value={
|
||||
customDomainData?.customDomain
|
||||
? `https://${customDomainData.customDomain?.hostname}/auth/v1/callback`
|
||||
: `https://${ui.selectedProjectRef}.supabase.co/auth/v1/callback`
|
||||
}
|
||||
/>
|
||||
</>
|
||||
)}
|
||||
|
||||
Reference in new issue
Block a user