feat: verify if user's email is disposable on sign up (#117)
* fix: Corrected "Stuffs" to "Stuff" on the landing page * fix: Corrected "Stuffs" to "Stuff" on the landing page * fix: Corrected Success Messages on the dashbaord * feat: Added Verification to check disposable emails * Update apps/dashboard/src/routes/signup/+page.svelte Co-authored-by: Rotimi Best <[email protected]> * Update apps/dashboard/src/routes/signup/+page.svelte Co-authored-by: Rotimi Best <[email protected]> --------- Co-authored-by: Rotimi Best <[email protected]>
This commit is contained in:
@@ -14,6 +14,7 @@
|
||||
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);
|
||||
@@ -43,6 +44,21 @@
|
||||
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
|
||||
|
||||
Reference in New Issue
Block a user