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 <best@classroomio.com> * Update apps/dashboard/src/routes/signup/+page.svelte Co-authored-by: Rotimi Best <best@classroomio.com> --------- Co-authored-by: Rotimi Best <best@classroomio.com>
This commit is contained in:
@@ -14,6 +14,7 @@
|
|||||||
import { profile } from '$lib/utils/store/user';
|
import { profile } from '$lib/utils/store/user';
|
||||||
import { currentOrg } from '$lib/utils/store/org';
|
import { currentOrg } from '$lib/utils/store/org';
|
||||||
import { capturePosthogEvent } from '$lib/utils/services/posthog';
|
import { capturePosthogEvent } from '$lib/utils/services/posthog';
|
||||||
|
import { snackbar } from '$lib/components/Snackbar/store';
|
||||||
|
|
||||||
let supabase = getSupabase();
|
let supabase = getSupabase();
|
||||||
let fields = Object.assign({}, SIGNUP_FIELDS);
|
let fields = Object.assign({}, SIGNUP_FIELDS);
|
||||||
@@ -43,6 +44,21 @@
|
|||||||
try {
|
try {
|
||||||
loading = true;
|
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 {
|
const {
|
||||||
data: { session },
|
data: { session },
|
||||||
error
|
error
|
||||||
|
|||||||
Reference in New Issue
Block a user