Skip to content

Commit

Permalink
Merge pull request #3 from kiwicopple/feature/auth-magic-link
Browse files Browse the repository at this point in the history
Add auth magic link capabilities.
  • Loading branch information
thorwebdev committed Nov 1, 2020
2 parents fc1dd25 + e044062 commit 88026d7
Show file tree
Hide file tree
Showing 4 changed files with 2,253 additions and 608 deletions.
5 changes: 3 additions & 2 deletions example/next-todo/components/Auth.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,11 @@ export default function Auth({}) {

const handleLogin = async (type, email, password) => {
try {
const { error, data } =
const { error, user } =
type === 'LOGIN'
? await supabase.auth.signIn({ email, password })
: await supabase.auth.signUp({ email, password })
if (!error && !user) alert('Check your email for the login link!')
if (error) console.log('Error returned:', error.message)
} catch (error) {
console.log('Error thrown:', error.message)
Expand Down Expand Up @@ -81,7 +82,7 @@ export default function Auth({}) {
href={'/channels'}
className="btn-black-outline"
>
Login
{password.length ? 'Sign in' : 'Send magic link'}
</a>
</div>

Expand Down

0 comments on commit 88026d7

Please sign in to comment.