From da694f140586d6a22096fc4cb6f280cf7deb81bc Mon Sep 17 00:00:00 2001 From: Harsh Karande Date: Wed, 8 Dec 2021 12:38:50 +0530 Subject: [PATCH] fix(example): javascript auth --- examples/javascript-auth/index.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/examples/javascript-auth/index.js b/examples/javascript-auth/index.js index efc0e7442b4..6df938bf3c2 100644 --- a/examples/javascript-auth/index.js +++ b/examples/javascript-auth/index.js @@ -30,7 +30,7 @@ const signUpSubmitted = (event) => { response.error ? alert(response.error.message) : setToken(response) }) .catch((err) => { - alert(err.response.text) + alert(err) }) } @@ -58,7 +58,7 @@ const logoutSubmitted = (event) => { supabase.auth .signOut() - .then((response) => { + .then((_response) => { document.querySelector('#access-token').value = '' document.querySelector('#refresh-token').value = '' alert('Logout successful') @@ -69,7 +69,7 @@ const logoutSubmitted = (event) => { } function setToken(response) { - if (response.data.confirmation_sent_at && !response.data.access_token) { + if (response.user.confirmation_sent_at && !response?.data?.access_token) { alert('Confirmation Email Sent') } else { document.querySelector('#access-token').value = response.data.access_token