This repository was archived by the owner on Nov 17, 2025. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -23,6 +23,7 @@ interface Profile {
2323 approval_status ?: string ;
2424 approved_by ?: string ;
2525 approved_at ?: string ;
26+ is_core_team ?: boolean ;
2627}
2728
2829interface AuthContextType {
@@ -324,19 +325,8 @@ export const AuthProvider: React.FC<{ children: React.ReactNode }> = ({ children
324325
325326 const userProfile = await fetchProfile ( session . user . id ) ;
326327
327- // Team members are auto-approved
328- const teamEmails = [
329- 'matteo.maspero@dlinrt.eu' ,
330- 'mustafa.kadhim@dlinrt.eu' ,
331- 'ana.barragan@dlinrt.eu' ,
332- 'paul.doolan@dlinrt.eu' ,
333- 'federico.mastroleo@dlinrt.eu' ,
334- 'viktor.rogowski@dlinrt.eu'
335- ] ;
336- const isTeamMember = teamEmails . includes ( session . user . email ?. toLowerCase ( ) || '' ) ;
337-
338- // Check approval status - but don't block team members or admins
339- if ( userProfile ?. approval_status === 'pending' && ! isTeamMember ) {
328+ // Check approval status - but don't block core team members or admins
329+ if ( userProfile ?. approval_status === 'pending' && ! userProfile ?. is_core_team ) {
340330 const { data : adminRole } = await supabase
341331 . from ( 'user_roles' )
342332 . select ( 'role' )
Original file line number Diff line number Diff line change @@ -526,6 +526,7 @@ export type Database = {
526526 first_name : string
527527 id : string
528528 institution : string | null
529+ is_core_team : boolean | null
529530 last_name : string
530531 linkedin_url : string | null
531532 mfa_backup_codes_generated_at : string | null
@@ -545,6 +546,7 @@ export type Database = {
545546 first_name : string
546547 id : string
547548 institution ?: string | null
549+ is_core_team ?: boolean | null
548550 last_name : string
549551 linkedin_url ?: string | null
550552 mfa_backup_codes_generated_at ?: string | null
@@ -564,6 +566,7 @@ export type Database = {
564566 first_name ?: string
565567 id ?: string
566568 institution ?: string | null
569+ is_core_team ?: boolean | null
567570 last_name ?: string
568571 linkedin_url ?: string | null
569572 mfa_backup_codes_generated_at ?: string | null
Original file line number Diff line number Diff line change 1+ -- Add is_core_team column to profiles table
2+ ALTER TABLE public .profiles
3+ ADD COLUMN is_core_team BOOLEAN DEFAULT false;
4+
5+ -- Set existing core team members
6+ UPDATE public .profiles
7+ SET is_core_team = true
8+ WHERE email IN (
9+ ' matteo.maspero@dlinrt.eu' ,
10+ ' mustafa.kadhim@dlinrt.eu' ,
11+ ' ana.barragan@dlinrt.eu' ,
12+ ' paul.doolan@dlinrt.eu' ,
13+ ' federico.mastroleo@dlinrt.eu' ,
14+ ' viktor.rogowski@dlinrt.eu' ,
15+ ' info@dlinrt.eu'
16+ );
17+
18+ -- Add comment for documentation
19+ COMMENT ON COLUMN public.profiles.is_core_team IS ' Core team members bypass account approval checks' ;
You can’t perform that action at this time.
0 commit comments