Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

234
Views
Problem with firebase(web) database/storage rules and authentication

I have a web app(upload.html) to upload files and data on firebase. I need to login (on index.html) to access upload.html .I can upload file to firebase on test mode but when I apply rules I can't upload file even if I'm authenticated (logged in). My goal is to allow only authenticated users to write data.

upload.js

//redirect to login page if user is not logged in
firebase.auth().onAuthStateChanged((user) => {
  if(!user){
    location.replace('./index.html');
  }
});

Firebase Rules:

Storage:

rules_version = '2';
service firebase.storage {
  match /b/{bucket}/o {
    match /{allPaths=**} {
      allow read;
      allow write: if request.auth != null; //this line is making problem 
    }
  }
}

Database:

{
  "rules": {
    ".read": true,
    ".write": "auth != null" //problem on this line
  }
}
about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!