0
votes

I have a very weird issue - I authenticate myself with firebase (by phone and link account with email/password credentials) and it works just fine (fetching data etc.).

When the app (for any reason) crahes for me I keep getting Permission denied, though Auth.auth().currentUser is not nil and apparently keeps all my credentials? Anyone encountered something like this?

Swift 4, Xcode 9.0, Firebase installed via pods

1
what is funny though, when I call Auth.auth().currentUser.refreshToken it goes back to normal :| but now it means I have to implement this logic to every firebase call I ever make. My whole server side is built on firebase, and it's supposed to be automatic AFAIK (it works just fine on android). Please fix it, it's extremely annoying team firebasebartol

1 Answers

0
votes

what are the rules you using? the simple user auth rules would be like this: { "rules": { "users": { ".read": "false", ".write": "true", "$uid": { ".read": "auth.uid === $uid", ".write": "auth.uid === $uid" } } } }

give it a try