I'm trying to use Image from next/image and am using firebase storage to store the image files.
However I'm getting a 403 (forbidden) error when doing the following:
<Image src={profilePicURL} ...otherProps/>
I've tried using with <img> instead and the url works fine, so I don't think it's a url or permissions issue.
Does anyone know what the issue could be?
next.config.js
module.exports = withBundleAnalyzer({
distDir: 'dist',
images: {
domains: ['firebasestorage.googleapis.com'],
},
webpack(config) {
// config stuff
return config
}
})
Firebase Storage Rules
match /profilePicture/{userID}/{fileName} {
allow read: if request.auth != null;
allow write: if request.auth.uid == userID;
}