简体   繁体   中英

Read Write Permission Denied Firebase

I am developing an app, I had my security rules setup. I was able to read and write in my firebase ref but today suddenly it's saying permission denied for everything.

Rules:

{
"rules":{
  "users":{
    "$uid":{
        ".read": "auth != null && auth.uid == $uid",
        ".write": "auth != null && auth.uid == $uid"
      }
    }
  }
}

I thought I might have accidentally changed something in the rules but I removed the read write auth and uid check and even then it wasn't working.

I'm guessing it has something to do with login session. How do I know if my session is still active? Because in my activity I can get the auth object and it's not null. It even has uid, token etc etc.

Also, in firebase auth settings, the default session length is 24 hours. Is it also applicable for email login type authentication?

Would I have to make my users login every 24 hours.

As you stated in your question your default session length is 24 hours. This means after those 24 hours the session expires and the user has to login again.

To prevent this you can change the default session length in your firebase dashboard.

Also take a look at the documentation .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM