feat: Enhance security and user management

Refines Firestore and Storage rules to enforce stricter access controls for signals and user-uploaded files. Updates user data handling to ensure root administrator privileges are correctly applied and enforced. Organizes uploaded scan files into user-specific directories within storage.
This commit is contained in:
desartstudio95
2026-05-06 23:48:03 +02:00
parent 3fe6dd4671
commit 175723475a
4 changed files with 29 additions and 3 deletions
+2 -1
View File
@@ -66,13 +66,14 @@ export const AnalysisView: React.FC<{ userData?: any }> = ({ userData }) => {
try {
let downloadUrl = null;
if (auth.currentUser) {
const fileRef = ref(storage, `files/${Date.now()}_${file.name}`);
const fileRef = ref(storage, `scans/${auth.currentUser.uid}/${Date.now()}_${file.name}`);
await uploadBytes(fileRef, file);
downloadUrl = await getDownloadURL(fileRef);
}
const base64 = preview.split(',')[1];
const analysis = await analyzeForexChart(base64, undefined, mode);
analysis.score = Math.round(analysis.score);
setResult(analysis);
if (auth.currentUser) {