mirror of
https://github.com/supabase/supabase.git
synced 2026-12-05 16:09:06 +00:00
## Problem SSL enforcement currently warns that the database will be restarted. This is no longer the case. ## Solution SSL enforcement no longer restarts the database. Update references to indicate that only non-SSL enabled connections are disabled. Only display warning when enabling SSL enforcement. ## Checklist Check all before review: - [x] I have read [CONTRIBUTING.md](https://github.com/supabase/supabase/blob/master/CONTRIBUTING.md) - [x] If I wrote a new docs topic or edited an existing topic, I used the `/write-the-docs` or `/edit-the-docs` skill, which applies the docs [style guide](https://github.com/supabase/supabase/tree/master/apps/docs/style-guide)
54 lines
1.7 KiB
TypeScript
54 lines
1.7 KiB
TypeScript
import { type PropsWithChildren } from 'react'
|
|
import {
|
|
AlertDialog,
|
|
AlertDialogAction,
|
|
AlertDialogCancel,
|
|
AlertDialogContent,
|
|
AlertDialogDescription,
|
|
AlertDialogFooter,
|
|
AlertDialogHeader,
|
|
AlertDialogTitle,
|
|
AlertDialogTrigger,
|
|
} from 'ui'
|
|
|
|
interface SSLEnforcementConfirmDialogProps {
|
|
isSubmitting: boolean
|
|
onConfirm: () => void
|
|
/**
|
|
* Controlled mode for callers whose control can't act as the dialog trigger
|
|
* (e.g. a switch, where a disabled control must never open the dialog).
|
|
* Omit both, and pass `children`, to render the children as the trigger.
|
|
*/
|
|
open?: boolean
|
|
onOpenChange?: (open: boolean) => void
|
|
}
|
|
|
|
export const SSLEnforcementConfirmDialog = ({
|
|
isSubmitting,
|
|
onConfirm,
|
|
open,
|
|
onOpenChange,
|
|
children,
|
|
}: PropsWithChildren<SSLEnforcementConfirmDialogProps>) => {
|
|
return (
|
|
<AlertDialog open={open} onOpenChange={onOpenChange}>
|
|
{children !== undefined && <AlertDialogTrigger asChild>{children}</AlertDialogTrigger>}
|
|
<AlertDialogContent size="medium">
|
|
<AlertDialogHeader>
|
|
<AlertDialogTitle>Enforce SSL on connections?</AlertDialogTitle>
|
|
<AlertDialogDescription>
|
|
Enforcing SSL immediately closes existing connections that don't use SSL. Clients must
|
|
reconnect with SSL. Existing SSL enabled connections are unaffected.
|
|
</AlertDialogDescription>
|
|
</AlertDialogHeader>
|
|
<AlertDialogFooter>
|
|
<AlertDialogCancel disabled={isSubmitting}>Cancel</AlertDialogCancel>
|
|
<AlertDialogAction variant="warning" disabled={isSubmitting} onClick={onConfirm}>
|
|
Enforce SSL
|
|
</AlertDialogAction>
|
|
</AlertDialogFooter>
|
|
</AlertDialogContent>
|
|
</AlertDialog>
|
|
)
|
|
}
|