Merge pull request #356 from ykdojo/master

Slack clone: make the confirmation flow clearer
This commit is contained in:
Copple authored and GitHub committed 2020-12-10 12:53:11 +08:00
commit 559f909cb7
1 file changed
+3
@@ -15,6 +15,9 @@ const Home = () => {
type === 'LOGIN'
? await supabase.auth.login(username, password)
: await supabase.auth.signup(username, password)
// If the user doesn't exist here and an error hasn't been raised yet,
// that must mean that a confirmation email has been sent.
if (!user) alert('Signup successful, confirmation mail should be sent soon!')
if (!!user) signIn(user.id, user.email)
} catch (error) {
console.log('error', error)