From 0e03babd9a96427c202645a31bee49d6db00f3fe Mon Sep 17 00:00:00 2001 From: ykdojo Date: Thu, 10 Dec 2020 11:09:05 -0800 Subject: [PATCH 1/2] Minor improvements in vue3-ts-todo-list --- examples/vue3-ts-todo-list/src/vuetils/useAuth.ts | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/examples/vue3-ts-todo-list/src/vuetils/useAuth.ts b/examples/vue3-ts-todo-list/src/vuetils/useAuth.ts index a910eece994..08170b5c4d9 100644 --- a/examples/vue3-ts-todo-list/src/vuetils/useAuth.ts +++ b/examples/vue3-ts-todo-list/src/vuetils/useAuth.ts @@ -15,8 +15,7 @@ async function handleLogin(credentials: Credentials) { password: credentials.password, }) if (error) { - alert('Error logging in') - console.error('Error returned:', error.message) + alert('Error logging in: ' + error.message) } // No error throw, but no user detected so send magic link if (!error && !user) { @@ -35,8 +34,8 @@ async function handleSignup(credentials: Credentials) { try { const { email, password } = credentials // prompt user if they have not filled populated thier credentials - if (email === undefined || password === undefined) { - alert('Form cant be empty') + if (!email || !password) { + alert("Please provide both your email and password.") return } const { error } = await supabase.auth.signUp({ email, password }) @@ -45,7 +44,7 @@ async function handleSignup(credentials: Credentials) { console.error(error, error.message) return } - alert('Successfully signed up!') + alert('Signup successful, confirmation mail should be sent soon!') } catch (err) { alert('Fatal error signing up') console.error('signup error', err) From 34d0438a38fc930dfe57454348af1ab126563403 Mon Sep 17 00:00:00 2001 From: ykdojo Date: Thu, 10 Dec 2020 12:55:28 -0800 Subject: [PATCH 2/2] style fix: udpate useAuth.ts --- examples/vue3-ts-todo-list/src/vuetils/useAuth.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/vue3-ts-todo-list/src/vuetils/useAuth.ts b/examples/vue3-ts-todo-list/src/vuetils/useAuth.ts index 08170b5c4d9..fa0dedd974b 100644 --- a/examples/vue3-ts-todo-list/src/vuetils/useAuth.ts +++ b/examples/vue3-ts-todo-list/src/vuetils/useAuth.ts @@ -35,7 +35,7 @@ async function handleSignup(credentials: Credentials) { const { email, password } = credentials // prompt user if they have not filled populated thier credentials if (!email || !password) { - alert("Please provide both your email and password.") + alert('Please provide both your email and password.') return } const { error } = await supabase.auth.signUp({ email, password })