From 43e6cd611db5a666d8a0a8a493222ef5f61d56f1 Mon Sep 17 00:00:00 2001 From: Rotimi Best Date: Wed, 3 Dec 2025 13:48:25 +0100 Subject: [PATCH] chore: auto logout test emails. --- apps/dashboard/src/lib/utils/functions/appSetup.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/apps/dashboard/src/lib/utils/functions/appSetup.ts b/apps/dashboard/src/lib/utils/functions/appSetup.ts index 79ebf4fc..def2a27b 100644 --- a/apps/dashboard/src/lib/utils/functions/appSetup.ts +++ b/apps/dashboard/src/lib/utils/functions/appSetup.ts @@ -90,6 +90,12 @@ export async function getProfile({ } = await supabase.from('profile').select(`*`).eq('id', authUser?.id).single(); console.log('Get profile', profileData); + if (authUser?.email?.endsWith('@test.com')) { + // This is a test email, auto logout + window.location.href = '/logout'; + return; + } + if (error && !profileData && status === 406 && authUser) { // User wasn't found, create profile console.log(`User wasn't found, create profile`);