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:
@@ -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;
|
||||
};
|
||||
Reference in New Issue
Block a user