chore: auto logout test emails.

This commit is contained in:
Rotimi Best
2025-12-03 13:48:25 +01:00
parent 900f5ec129
commit 43e6cd611d
@@ -90,6 +90,12 @@ export async function getProfile({
} = await supabase.from('profile').select(`*`).eq('id', authUser?.id).single(); } = await supabase.from('profile').select(`*`).eq('id', authUser?.id).single();
console.log('Get profile', profileData); 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) { if (error && !profileData && status === 406 && authUser) {
// User wasn't found, create profile // User wasn't found, create profile
console.log(`User wasn't found, create profile`); console.log(`User wasn't found, create profile`);