Open gregoryfoster opened 1 year ago
Same issue when navigating via profile icon in upper right, "Your account", and attempting to upload photo.
The main thing missing I believe was that I had yet to publish the Firestore and Firebase Storage security rules. After publishing the rules and a minor refactor of the code, the user photo management functionality appears to work.
firebase deploy --only firestore:rules
firebase deploy --only storage:rules
Slightly farther, here's the new error message:
Uncaught (in promise) TypeError: Cannot read properties of null (reading 'uid')
at updateUserPhoto (firebase.js:174:46)
at HTMLInputElement.uploadUserPhoto (user.js:30:247)
Error:
Uncaught (in promise) FirebaseError: Firebase Storage: User does not have permission to access 'users/y3iPLGpfixTxRAEcVvfXXsRMJeT2/user_photos/cannabis_observer-icon-square.png'. (storage/unauthorized)