Currently
allow read, write: if request.auth.uid != null && request.auth.token.admin == true
Is it okay to do smth like this?
allow read, write: if request.auth.token.admin == true
>Solution :
It’s not necessary as trying to read property token of null (if user is not signed in) will just error out and reject the operation. You’ll find many examples in the documentation that do not check request.ath != null explicitly before request.auth.uid == '---' or any role validation.
request.auth.uid != null is redundant as token will be defined only if user is logged in and the role validation will pass if user is an admin irrespective of user ID.