88 }"
99 >
1010 <Container direction =" vertical" gap =" large" :appearance =" appearance" >
11- <div >
12- <Label htmlFor =" email" :appearance =" appearance" >
13- {{ labels?.email_input_label }}
14- </Label >
15- <Input
16- id =" email"
17- type =" email"
18- name =" email"
19- autoComplete =" email"
20- autofocus
21- :placeholder =" labels?.email_input_placeholder"
22- :appearance =" appearance"
23- v-model =" email"
24- />
25- </div >
11+ <Container direction =" vertical" gap =" large" :appearance =" appearance" >
12+ <div >
13+ <Label htmlFor =" email" :appearance =" appearance" >
14+ {{ labels?.email_input_label }}
15+ </Label >
16+ <Input
17+ id =" email"
18+ type =" email"
19+ name =" email"
20+ autoComplete =" email"
21+ autofocus
22+ :placeholder =" labels?.email_input_placeholder"
23+ :appearance =" appearance"
24+ v-model =" email"
25+ />
26+ </div >
27+ </Container >
2628
2729 <Button
2830 type =" submit"
5557<script lang="ts" setup>
5658import { ref , computed } from ' vue'
5759import { SupabaseClient } from ' @supabase/supabase-js'
58- import { I18nVariables , RedirectTo , VIEWS } from ' @supabase/auth-ui-shared'
60+ import { RedirectTo , VIEWS } from ' @supabase/auth-ui-shared'
5961
60- import { AuthViewKey , type Appearance , type AuthViewInjection } from ' ../types'
62+ import {
63+ AuthViewKey ,
64+ type Appearance ,
65+ type AuthViewInjection ,
66+ type AuthI18nVariables
67+ } from ' ../types'
6168import { Anchor , Button , Container , Input , Label , Message } from ' ../ui/index'
6269import { injectStrict } from ' ../utils'
6370import { useSupabaseUser } from ' ./UserContextProvider'
@@ -67,7 +74,7 @@ export interface MagicLinkProps {
6774 supabaseClient: SupabaseClient
6875 redirectTo? : RedirectTo
6976 showLinks? : boolean
70- i18n? : I18nVariables
77+ i18n? : AuthI18nVariables
7178}
7279
7380const props = withDefaults (defineProps <MagicLinkProps >(), {})
@@ -82,7 +89,7 @@ const isLoading = ref(false)
8289const { authView, setAuthView } = injectStrict <AuthViewInjection >(AuthViewKey )
8390
8491const labels = computed (
85- () => props .i18n ?.[authView .value ] as I18nVariables [' magic_link' ]
92+ () => props .i18n ?.[authView .value ] as AuthI18nVariables [' magic_link' ]
8693)
8794
8895const handleSubmit = async (e : Event ) => {
@@ -93,11 +100,14 @@ const handleSubmit = async (e: Event) => {
93100 const isAnonymous = supabaseUser .value ?.is_anonymous
94101 let signInError: Error | null = null
95102 if (isAnonymous ) {
96- const { error : err } = await props .supabaseClient .auth .updateUser ({
97- email: email .value
98- }, {
99- emailRedirectTo: props .redirectTo
100- })
103+ const { error : err } = await props .supabaseClient .auth .updateUser (
104+ {
105+ email: email .value
106+ },
107+ {
108+ emailRedirectTo: props .redirectTo
109+ }
110+ )
101111 signInError = err
102112 } else {
103113 const { error : err } = await props .supabaseClient .auth .signInWithOtp ({
0 commit comments