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 <best@classroomio.com>
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
@@ -1,21 +1,31 @@
<script>
import Modal from '../Modal/index.svelte';
import { writable } from 'svelte/store';
import { onMount, onDestroy } from 'svelte';
import { welcomeModalStore } from './store';
import { page } from '$app/stores';
import { goto } from '$app/navigation';
import { currentOrgPath } from '$lib/utils/store/org';
import {
triggerSendEmail,
NOTIFICATION_NAME
} from '$lib/utils/services/notification/notification';
import { profile } from '$lib/utils/store/user';
let query = new URLSearchParams($page.url.search);
let welcomePopup = query.get('welcomePopup');
const closeModal = () => {
$welcomeModalStore.open = false;
triggerSendEmail(NOTIFICATION_NAME.WELCOME_TO_APP, {
to: $profile.email,
name: $profile.fullname
});
goto($currentOrgPath + '/courses?create=true');
};
</script>
<Modal
onClose={closeModal}
bind:open={$welcomeModalStore.open}
open={welcomePopup === 'true'}
width="w-9/12"
maxWidth="w-[800px]"
modalHeading="Welcome"
>
<p class="text-black dark:text-white text-sm md:text-base lg:text-lg">