feat: verify users email (#215)

* worked on the email verification

* worked on the email verification

* fixed the emailing issue and the supabase updating issue

* chore: add timer to resend, add supabase.server, enforce unique email

* chore: remove nodemailer logger

* remove async

* remove disposable email verification

---------

Co-authored-by: Rotimi Best <[email protected]>
This commit is contained in:
Em_Dev
2024-03-22 06:30:24 +01:00
committed by GitHub
co-authored by Rotimi Best
parent 5a566cbb4f
commit bd905b580a
17 changed files with 261 additions and 38 deletions
@@ -14,7 +14,6 @@
import { profile } from '$lib/utils/store/user';
import { currentOrg } from '$lib/utils/store/org';
import { capturePosthogEvent } from '$lib/utils/services/posthog';
import { snackbar } from '$lib/components/Snackbar/store';
let supabase = getSupabase();
let fields = Object.assign({}, SIGNUP_FIELDS);
@@ -44,21 +43,6 @@
try {
loading = true;
// Check if the email address is disposable
const emailCheck = await fetch('https://is-disposable-email.ephraimduncan68.workers.dev/', {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify({ email: fields.email })
});
const emailCheckResponse = await emailCheck.json();
if (emailCheckResponse.isDisposable === true) {
snackbar.error('The email you provided is disposable');
return;
}
const {
data: { session },
error