Skip to content
This repository was archived by the owner on Oct 23, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .changeset/pretty-pumpkins-admire.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@supabase/auth-ui-shared': patch
'@supabase/auth-ui-react': patch
---

Fix check for blank email address on magic links
11 changes: 9 additions & 2 deletions packages/react/src/components/Auth/interfaces/MagicLink.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,12 @@ function MagicLink({
setError('')
setMessage('')
setLoading(true)

if (email.length === 0) {
setError(i18n?.magic_link?.empty_email_address as string)
setLoading(false)
return
}
const { error } = await supabaseClient.auth.signInWithOtp({
email,
options: { emailRedirectTo: redirectTo },
Expand All @@ -60,9 +66,10 @@ function MagicLink({
type="email"
autoFocus
placeholder={labels?.email_input_placeholder}
onChange={(e: React.ChangeEvent<HTMLInputElement>) =>
onChange={(e: React.ChangeEvent<HTMLInputElement>) => {
if (setError) setError('')
setEmail(e.target.value)
}
}}
appearance={appearance}
/>
</div>
Expand Down
1 change: 1 addition & 0 deletions packages/shared/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ export type I18nVariables = {
loading_button_label?: string
link_text?: string
confirmation_text?: string
empty_email_address?: string
}
forgotten_password?: {
email_label?: string
Expand Down