🚀 Set Storage Security Rules
You must set rules to control who can upload and access files.
→ Click the "Rules" tab at the top of the Storage section.
→ Delete the existing rules.
→ Paste in the following rules. This code allows a user to upload, download and edit files only within a folder that matches their own User ID.
rules_version = '2';
service firebase.storage {
match /b/{bucket}/o {
match /user_uploads/{uid}/{allPaths=**} {
allow read, write: if request.auth != null && request.auth.uid == uid;
}
}
}→ Click the "Publish" button.
Your Firebase Storage is now set up and secured.