a tool for shared writing and social publishing
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

prevent others from adding leaflet.pub domains right now

+22 -14
+22 -14
actions/domains/addDomain.ts
··· 19 19 export async function addDomain(domain: string) { 20 20 let auth_token = cookies().get("auth_token")?.value; 21 21 if (!auth_token) return {}; 22 + let { data: auth_data } = await supabase 23 + .from("email_auth_tokens") 24 + .select( 25 + `*, 26 + identities( 27 + *, 28 + custom_domains(*) 29 + )`, 30 + ) 31 + .eq("id", auth_token) 32 + .eq("confirmed", true) 33 + .single(); 34 + if (!auth_data || !auth_data.email) return {}; 35 + if ( 36 + domain.includes("leaflet.pub") && 37 + ![ 38 + "celine@hyperlink.academy", 39 + "brendan@hyperlink.academy", 40 + "jared@hyperlink.academy", 41 + ].includes(auth_data.email) 42 + ) 43 + return {}; 22 44 23 45 try { 24 46 await vercel.projects.addProjectDomain({ ··· 45 67 46 68 return { error }; 47 69 } 48 - 49 - let { data: auth_data } = await supabase 50 - .from("email_auth_tokens") 51 - .select( 52 - `*, 53 - identities( 54 - *, 55 - custom_domains(*) 56 - )`, 57 - ) 58 - .eq("id", auth_token) 59 - .eq("confirmed", true) 60 - .single(); 61 - if (!auth_data || !auth_data.email) return {}; 62 70 63 71 await supabase.from("custom_domains").insert({ 64 72 domain,