Below is the rule.
{
"rules": {
".read": true,
".write": "auth != null"
}
}
Here is the code I am using to add. The line mAuth,getCurrentUser.isAnonymous
returned false and userid also printed the value. The user is authenticated but unable to write to users table.
System.out.println("Anonymous - "+ mAuth.getCurrentUser().isAnonymous());
mRef = new Firebase("https://moe-90cc7.firebaseio.com/users");
String userid = mAuth.getCurrentUser().getUid();
System.out.println("userid---" + userid);
mRef.child(userid).setValue("1");
When I change rule to
read: true
write: true
it works fine, but the point is why its not working with auth!=null
rule when I am authenticated user.
Is there anything I can do to double check if the user is authenticated or not?