Mark oriol.rodrigo@craze-group.com as validated in status checks and admin list

This commit is contained in:
Christian Vidal Wolf
2026-07-14 16:05:28 +02:00
parent 56593f942b
commit 10d3dadb5d
+15
View File
@@ -148,6 +148,10 @@ export default async function handler(req, res) {
return res.json({ validated: true });
}
if (callerEmail.toLowerCase() === 'oriol.rodrigo@craze-group.com') {
return res.json({ validated: true });
}
const approvalsRes = await fetch(`${SUPABASE_URL}/rest/v1/user_approvals?id=eq.${callerId}&select=validated`, {
headers: {
'apikey': SUPABASE_SERVICE_KEY,
@@ -210,6 +214,17 @@ export default async function handler(req, res) {
return { id, email, created_at: createdAt, status };
});
// Inject mock user oriol.rodrigo@craze-group.com so they display as validated in admin UI
const hasOriol = mergedUsers.some(u => u.email?.toLowerCase() === 'oriol.rodrigo@craze-group.com');
if (!hasOriol) {
mergedUsers.push({
id: 'mock-id-oriol',
email: 'oriol.rodrigo@craze-group.com',
created_at: new Date(2026, 0, 1).toISOString(),
status: 'Validated'
});
}
return res.json({ users: mergedUsers, warning });
}