Skip to content

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

Add success notifications for auth config settings

Joshen Limc9d0080879df
diff --git a/studio/components/interfaces/Auth/AuthProvidersForm/ProviderForm.tsx b/studio/components/interfaces/Auth/AuthProvidersForm/ProviderForm.tsx
index 48f75c149ed..dd4f6d27dbd 100644
--- a/studio/components/interfaces/Auth/AuthProvidersForm/ProviderForm.tsx
+++ b/studio/components/interfaces/Auth/AuthProvidersForm/ProviderForm.tsx
@@ -44,8 +44,13 @@ const ProviderForm: FC<Props> = ({ provider }) => {
await authConfig.update(values)
setSubmitting(false)
setOpen(false)
- } catch (error) {
- console.error(error)
+ ui.setNotification({ category: 'success', message: 'Successfully updated settings' })
+ } catch (error: any) {
+ ui.setNotification({
+ error,
+ category: 'error',
+ message: `Failed to update settings: ${error?.message}`,
+ })
}
}
@@ -58,11 +63,11 @@ const ProviderForm: FC<Props> = ({ provider }) => {
<Collapsible.Trigger asChild>
<button
type="button"
- className="text-scale-1200 group flex w-full items-center justify-between rounded py-3 px-6"
+ className="group flex w-full items-center justify-between rounded py-3 px-6 text-scale-1200"
>
<div className="flex items-center gap-3">
<IconChevronUp
- className="text-scale-800 data-open-parent:rotate-0 data-closed-parent:rotate-180 transition"
+ className="text-scale-800 transition data-open-parent:rotate-0 data-closed-parent:rotate-180"
strokeWidth={2}
width={14}
/>
@@ -75,14 +80,14 @@ const ProviderForm: FC<Props> = ({ provider }) => {
</div>
<div className="flex items-center gap-3">
{isActive ? (
- <div className="bg-brand-200 border-brand-700 text-brand-900 flex items-center gap-1 rounded-full border py-1 px-1 text-xs">
- <span className="bg-brand-900 text-brand-200 rounded-full p-0.5 text-xs">
+ <div className="flex items-center gap-1 rounded-full border border-brand-700 bg-brand-200 py-1 px-1 text-xs text-brand-900">
+ <span className="rounded-full bg-brand-900 p-0.5 text-xs text-brand-200">
<IconCheck strokeWidth={2} size={12} />
</span>
<span className="px-1">Enabled</span>
</div>
) : (
- <div className="bg-scale-100 dark:bg-scale-300 border-scale-500 dark:border-scale-700 text-scale-900 rounded-md border py-1 px-3 text-xs">
+ <div className="rounded-md border border-scale-500 bg-scale-100 py-1 px-3 text-xs text-scale-900 dark:border-scale-700 dark:bg-scale-300">
Disabled
</div>
)}
@@ -101,8 +106,8 @@ const ProviderForm: FC<Props> = ({ provider }) => {
<Collapsible.Content>
<div
className="
- bg-scale-100 dark:bg-scale-300
- text-scale-1200 border-scale-500 group border-t py-6 px-6
+ group border-t
+ border-scale-500 bg-scale-100 py-6 px-6 text-scale-1200 dark:bg-scale-300
"
>
<div className="mx-auto my-6 max-w-md space-y-6">
@@ -217,7 +222,7 @@ const ProviderForm: FC<Props> = ({ provider }) => {
)}
{provider.misc.requiresRedirect && (
<>
- <ReactMarkdown className="text-scale-900 text-xs">
+ <ReactMarkdown className="text-xs text-scale-900">
{provider.misc.helper}
</ReactMarkdown>
<Input
diff --git a/studio/components/interfaces/Auth/AutoSchemaForm.tsx b/studio/components/interfaces/Auth/AutoSchemaForm.tsx
index f934102e951..0e8d2addf93 100644
--- a/studio/components/interfaces/Auth/AutoSchemaForm.tsx
+++ b/studio/components/interfaces/Auth/AutoSchemaForm.tsx
@@ -58,7 +58,7 @@ const AutoSchemaForm = observer(() => {
setSubmitting(false)
ui.setNotification({
category: 'success',
- message: `Updated settings`,
+ message: `Successfully updated settings`,
})
resetForm({ values: values, initialValues: values })
} catch (error) {
@@ -109,7 +109,7 @@ const AutoSchemaForm = observer(() => {
/>
</FormSectionContent>
</FormSection>
- <div className="border-scale-400 border-t"></div>
+ <div className="border-t border-scale-400"></div>
<FormSection header={<FormSectionLabel>User Sessions</FormSectionLabel>}>
<FormSectionContent loading={!isLoaded}>
{/* Permitted redirects for anything on that domain */}
diff --git a/studio/components/interfaces/Auth/RedirectDomains/RedirectDomains.tsx b/studio/components/interfaces/Auth/RedirectDomains/RedirectDomains.tsx
index f860b52bba9..f8f3f3c4596 100644
--- a/studio/components/interfaces/Auth/RedirectDomains/RedirectDomains.tsx
+++ b/studio/components/interfaces/Auth/RedirectDomains/RedirectDomains.tsx
@@ -32,9 +32,14 @@ const RedirectDomains = () => {
authConfig.update({ URI_ALLOW_LIST: payload.toString() })
setSubmitting(false)
setOpen(false)
+ ui.setNotification({ category: 'success', message: 'Successfully added domain' })
} catch (error: any) {
setSubmitting(false)
- ui.notification?.error('Failed to update domain: ', error?.message)
+ ui.setNotification({
+ error,
+ category: 'error',
+ message: `Failed to update domain: ${error?.message}`,
+ })
}
}
@@ -48,9 +53,14 @@ const RedirectDomains = () => {
await authConfig.update({ URI_ALLOW_LIST: payload.toString() })
setIsDeleting(false)
setSelectedDomainToDelete(undefined)
+ ui.setNotification({ category: 'success', message: 'Successfully removed domain' })
} catch (error: any) {
setIsDeleting(false)
- ui.notification?.error('Failed to remove domain: ', error?.message)
+ ui.setNotification({
+ error,
+ category: 'error',
+ message: `Failed to remove domain: ${error?.message}`,
+ })
}
}