You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Centralize HTML safety and align admin authorization checks
Add shared HTML/JSON-LD sanitization utilities and apply them to rich text and structured data rendering paths to reduce script injection risk. Standardize admin checks around profiles.is_admin with legacy fallback support, and align schema and seeding scripts with the new admin source of truth.
console.error(`Admin Check DB Error: Failed to query admins table for user ${user.id}. RLS issue?`,{code: dbError.code,message: dbError.message,details: dbError.details,hint: dbError.hint});
74
-
returnfalse;// Error occurred, assume not admin for safety
75
-
}else{
76
-
console.log(`Admin Check DB Success: Query for user ${user.id} returned:`,adminData);
82
+
if(adminError){
83
+
console.error('Admin check failed for profiles/admins lookup',{
84
+
userId: user.id,
85
+
profileError: profileError.message,
86
+
adminError: adminError.message,
87
+
});
88
+
returnfalse;
77
89
}
78
90
79
-
// If adminData exists and is_admin is true, return true
80
91
returnadminData?.is_admin===true;
81
92
}
82
93
@@ -582,4 +593,4 @@ export async function updateUserSubscriptionPlan(
0 commit comments