Files
supabase/apps/studio/components/interfaces/Docs/Pages/UserManagement.tsx
Danny White 38e09e1754 chore(studio + docs + ui library): update auth email template copy docs (#45706)
## What kind of change does this PR introduce?

Docs update. Part of DEPR-198.

## What is the current behaviour?

Auth email template examples and Studio template labels still reflect
older default copy in a few places.

## What is the new behaviour?

Updates Auth docs, local development docs, related snippets, Studio
template labels, and UI Library examples to [match the updated default
Auth email
copy](https://linear.app/supabase/document/email-template-copywriting-updates-04bba460fd2a).


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **Documentation**
* Updated authentication email template names and descriptions across
guides, replacing "Magic link" with "Sign-in link or code" terminology
* Revised security notification email naming from "Identity
linked/unlinked" to "Sign-in method linked/removed" and "MFA method" to
"Verification method"
* Updated email template example content with improved wording (e.g.,
"Confirm your email address" instead of "Confirm your signup")

* **UI Updates**
* Refined authentication-related UI text labels and descriptions in the
dashboard

[![Review Change
Stack](https://storage.googleapis.com/coderabbit_public_assets/review-stack-in-coderabbit-ui.svg)](https://app.coderabbit.ai/change-stack/supabase/supabase/pull/45706)
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: Joshen Lim <joshenlimek@gmail.com>
2026-05-22 11:47:36 +10:00

314 lines
9.7 KiB
TypeScript

import { useParams } from 'common'
import CodeSnippet from '../CodeSnippet'
import { DocSection } from '../DocSection'
import Snippets from '../Snippets'
import { InlineLink } from '@/components/ui/InlineLink'
import { useProjectSettingsV2Query } from '@/data/config/project-settings-v2-query'
import { useIsFeatureEnabled } from '@/hooks/misc/useIsFeatureEnabled'
import { DOCS_URL } from '@/lib/constants'
import { makeRandomString } from '@/lib/helpers'
const randomPassword = makeRandomString(20)
interface UserManagementProps {
selectedLang: 'bash' | 'js'
showApiKey: string
}
export const UserManagement = ({ selectedLang, showApiKey }: UserManagementProps) => {
const { ref: projectRef } = useParams()
const keyToShow = showApiKey ? showApiKey : 'SUPABASE_KEY'
const { authenticationSignInProviders } = useIsFeatureEnabled([
'authentication:sign_in_providers',
])
const { data: settings } = useProjectSettingsV2Query({ projectRef })
const protocol = settings?.app_config?.protocol ?? 'https'
const hostEndpoint = settings?.app_config?.endpoint ?? ''
const endpoint = `${protocol}://${hostEndpoint ?? ''}`
return (
<div className="flex flex-col flex-1">
<DocSection
title="User Management"
content={
<>
<p>Supabase makes it easy to manage your users.</p>
<p>
Supabase assigns each user a unique ID. You can reference this ID anywhere in your
database. For example, you might create a <code>profiles</code> table that references
the user using a <code>user_id</code> field.
</p>
<p>
Supabase already has built in the routes to sign up, login, and log out for managing
users in your apps and websites.
</p>
</>
}
/>
<DocSection
title="Sign up"
content={
<>
<p>Allow your users to sign up and create a new account.</p>
<p>
After they have signed up, all interactions using the Supabase JS client will be
performed as "that user".
</p>
</>
}
snippets={
<CodeSnippet
selectedLang={selectedLang}
snippet={Snippets.authSignup(endpoint, keyToShow, randomPassword)}
/>
}
/>
<DocSection
title="Log in with Email/Password"
content={
<>
<p>If an account is created, users can login to your app.</p>
<p>
After they have logged in, all interactions using the Supabase JS client will be
performed as "that user".
</p>
</>
}
snippets={
<CodeSnippet
selectedLang={selectedLang}
snippet={Snippets.authLogin(endpoint, keyToShow, randomPassword)}
/>
}
/>
<DocSection
title="Sign in with magic link"
content={
<>
<p>Send a user a passwordless link which they can use to redeem an access_token.</p>
<p>
After they have clicked the link, all interactions using the Supabase JS client will
be performed as "that user".
</p>
</>
}
snippets={
<CodeSnippet
selectedLang={selectedLang}
snippet={Snippets.authMagicLink(endpoint, keyToShow)}
/>
}
/>
<DocSection
title="Sign Up with Phone/Password"
content={
<>
<p>
A phone number can be used instead of an email as a primary account confirmation
mechanism.
</p>
<p>
The user will receive a mobile OTP via sms with which they can verify that they
control the phone number.
</p>
<p>
You must enter your own twilio credentials on the auth settings page to enable sms
confirmations.
</p>
</>
}
snippets={
<CodeSnippet
selectedLang={selectedLang}
snippet={Snippets.authPhoneSignUp(endpoint, keyToShow)}
/>
}
/>
<DocSection
title="Login via SMS OTP"
content={
<>
<p>
SMS OTPs work like magic links, except you have to provide an interface for the user
to verify the 6 digit number they receive.
</p>
<p>
You must enter your own twilio credentials on the auth settings page to enable
SMS-based Logins.
</p>
</>
}
snippets={
<CodeSnippet
selectedLang={selectedLang}
snippet={Snippets.authMobileOTPLogin(endpoint, keyToShow)}
/>
}
/>
<DocSection
title="Verify an SMS OTP"
content={
<>
<p>
Once the user has received the OTP, have them enter it in a form and send it for
verification
</p>
<p>
You must enter your own twilio credentials on the auth settings page to enable
SMS-based OTP verification.
</p>
</>
}
snippets={
<CodeSnippet
selectedLang={selectedLang}
snippet={Snippets.authMobileOTPVerify(endpoint, keyToShow)}
/>
}
/>
{authenticationSignInProviders && (
<DocSection
title="Log in with Third Party OAuth"
content={
<>
<p>
Users can log in with Third Party OAuth like Google, Facebook, GitHub, and more. You
must first enable each of these in the Auth Providers settings{' '}
<span className="text-green-500">
<InlineLink key={'AUTH'} href={`/project/${projectRef}/auth/providers`}>
here
</InlineLink>
</span>{' '}
.
</p>
<p>
View all the available{' '}
<InlineLink href={`${DOCS_URL}/guides/auth#providers`}>
Third Party OAuth providers
</InlineLink>
</p>
<p>
After they have logged in, all interactions using the Supabase JS client will be
performed as "that user".
</p>
<p>
Generate your Client ID and secret from:{` `}
<InlineLink href="https://console.developers.google.com/apis/credentials">
Google
</InlineLink>
,{` `}
<InlineLink href="https://github.com/settings/applications/new">GitHub</InlineLink>,
{` `}
<InlineLink href="https://gitlab.com/oauth/applications">GitLab</InlineLink>,{` `}
<InlineLink href="https://developers.facebook.com/apps/">Facebook</InlineLink>,{` `}
<InlineLink href="https://support.atlassian.com/bitbucket-cloud/docs/use-oauth-on-bitbucket-cloud/">
Bitbucket
</InlineLink>
.
</p>
</>
}
snippets={
<CodeSnippet
selectedLang={selectedLang}
snippet={Snippets.authThirdPartyLogin(endpoint, keyToShow)}
/>
}
/>
)}
<DocSection
title="User"
content={<p>Get the JSON object for the logged in user.</p>}
snippets={
<CodeSnippet
selectedLang={selectedLang}
snippet={Snippets.authUser(endpoint, keyToShow)}
/>
}
/>
<DocSection
title="Forgotten Password Email"
content={
<p>
Sends the user a log in link via email. Once logged in you should direct the user to a
new password form. And use "Update User" below to save the new password.
</p>
}
snippets={
<CodeSnippet
selectedLang={selectedLang}
snippet={Snippets.authRecover(endpoint, keyToShow)}
/>
}
/>
<DocSection
title="Update User"
content={
<p>
Update the user with a new email or password. Each key (email, password, and data) is
optional
</p>
}
snippets={
<CodeSnippet
selectedLang={selectedLang}
snippet={Snippets.authUpdate(endpoint, keyToShow)}
/>
}
/>
<DocSection
title="Log out"
content={
<p>
After calling log out, all interactions using the Supabase JS client will be
"anonymous".
</p>
}
snippets={
<CodeSnippet
selectedLang={selectedLang}
snippet={Snippets.authLogout(endpoint, keyToShow)}
/>
}
/>
<DocSection
title="Send a User an Invite over Email"
content={
<>
<p>Send a user a passwordless link which they can use to sign up and log in.</p>
<p>
After they have clicked the link, all interactions using the Supabase JS client will
be performed as "that user".
</p>
<p>
This endpoint requires you use the <code>service_role_key</code> when initializing the
client, and should only be invoked from the server, never from the client.
</p>
</>
}
snippets={
<CodeSnippet
selectedLang={selectedLang}
snippet={Snippets.authInvite(endpoint, keyToShow)}
/>
}
/>
</div>
)
}