Skip to content

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

Bug fix for #27475 [Send Magic Link button text change] (#40276)

kunalvirmani98e456054e7328
diff --git a/apps/studio/components/interfaces/Auth/Users/UserOverview.tsx b/apps/studio/components/interfaces/Auth/Users/UserOverview.tsx
index c0d67fe4193..516e60b2111 100644
--- a/apps/studio/components/interfaces/Auth/Users/UserOverview.tsx
+++ b/apps/studio/components/interfaces/Auth/Users/UserOverview.tsx
@@ -45,6 +45,7 @@ export const UserOverview = ({ user, onDeleteSuccess }: UserOverviewProps) => {
const isEmailAuth = user.email !== null
const isPhoneAuth = user.phone !== null
const isBanned = user.banned_until !== null
+ const isVerified = user.confirmed_at != null
const { authenticationSignInProviders } = useIsFeatureEnabled([
'authentication:sign_in_providers',
@@ -110,10 +111,18 @@ export const UserOverview = ({ user, onDeleteSuccess }: UserOverviewProps) => {
const { mutate: sendMagicLink, isLoading: isSendingMagicLink } = useUserSendMagicLinkMutation({
onSuccess: (_, vars) => {
setSuccessAction('send_magic_link')
- toast.success(`Sent magic link to ${vars.user.email}`)
+ toast.success(
+ isVerified
+ ? `Sent magic link to ${vars.user.email}`
+ : `Sent confirmation email to ${vars.user.email}`
+ )
},
onError: (err) => {
- toast.error(`Failed to send magic link: ${err.message}`)
+ toast.error(
+ isVerified
+ ? `Failed to send magic link: ${err.message}`
+ : `Failed to send confirmation email: ${err.message}`
+ )
},
})
const { mutate: sendOTP, isLoading: isSendingOTP } = useUserSendOTPMutation({
@@ -294,11 +303,15 @@ export const UserOverview = ({ user, onDeleteSuccess }: UserOverviewProps) => {
}
/>
<RowAction
- title="Send magic link"
- description="Passwordless login via email for the user"
+ title={isVerified ? 'Send Magic Link' : 'Send confirmation email'}
+ description={
+ isVerified
+ ? 'Passwordless login via email for the user'
+ : 'Send a confirmation email to the user'
+ }
button={{
icon: <Mail />,
- text: 'Send magic link',
+ text: isVerified ? 'Send magic link' : 'Send confirmation email',
isLoading: isSendingMagicLink,
disabled: !canSendMagicLink,
onClick: () => {
@@ -308,8 +321,10 @@ export const UserOverview = ({ user, onDeleteSuccess }: UserOverviewProps) => {
success={
successAction === 'send_magic_link'
? {
- title: 'Magic link sent',
- description: `The link in the email is valid for ${formattedExpiry}`,
+ title: isVerified ? 'Magic link sent' : 'Confirmation email sent',
+ description: isVerified
+ ? `The link in the email is valid for ${formattedExpiry}`
+ : 'The confirmation email has been sent to the user',
}
: undefined
}