From d84afd27e54712e67d901a29fb4a50ae319b3b13 Mon Sep 17 00:00:00 2001 From: ykdojo Date: Wed, 9 Dec 2020 18:05:34 -0800 Subject: [PATCH] Slack clone: make the confirmation flow clearer I'm making the confirmation flow clearer by showing an alert indicating that signing up was successful and that a confirmation email will be sent soon. --- examples/nextjs-slack-clone/pages/index.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/examples/nextjs-slack-clone/pages/index.js b/examples/nextjs-slack-clone/pages/index.js index 3b7963670d1..0d5def7e6af 100644 --- a/examples/nextjs-slack-clone/pages/index.js +++ b/examples/nextjs-slack-clone/pages/index.js @@ -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)