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
@@ -0,0 +1,24 @@
import { PUBLIC_SUPABASE_URL } from '$env/static/public';
import { PRIVATE_SUPABASE_SERVICE_ROLE } from '$env/static/private';
import { createClient, SupabaseClient } from '@supabase/supabase-js';
export let supabase: SupabaseClient;
/**
* Should only be called on server files
*
* @returns supabase
*/
export const getServerSupabase = () => {
if (supabase) return supabase;
supabase = createClient(PUBLIC_SUPABASE_URL, PRIVATE_SUPABASE_SERVICE_ROLE, {
auth: {
persistSession: false,
autoRefreshToken: false,
detectSessionInUrl: false
}
});
return supabase;
};