Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get Started - Profile - unable to upload image #2

Open
gregoryfoster opened this issue Nov 27, 2022 · 3 comments
Open

Get Started - Profile - unable to upload image #2

gregoryfoster opened this issue Nov 27, 2022 · 3 comments
Assignees
Labels
bug Something isn't working

Comments

@gregoryfoster
Copy link
Member

gregoryfoster commented Nov 27, 2022

  1. On initial sign in, prompted to "Create your profile"
  2. On selecting an image to upload, error in browser console

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)

@gregoryfoster gregoryfoster added the bug Something isn't working label Nov 27, 2022
@gregoryfoster
Copy link
Member Author

Same issue when navigating via profile icon in upper right, "Your account", and attempting to upload photo.

@keeganskeate
Copy link
Contributor

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

@gregoryfoster
Copy link
Member Author

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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants