I'm using the following rules:
service firebase.storage {
match /b/xxxxxxx.appspot.com/o {
match /proUsers/{userId}/{allPaths=**} {
allow read, write: if request.auth.uid == userId && request.resource.size < 2 * 1024 * 1024 && request.resource.contentType.matches('image/.*');
}
}
}
This is how I'm creating the ref for saving:
storageRef.child(`proUsers/${userId}/${prizeData.title}_${prizeData.createdAtTimeStamp}`).put(file, metadata)
Attempting to delete it I'm creating this Ref:
const prizeImageRef = storageRef.child(`proUsers/${userId}/${prizeData.title}_${prizeData.createdAtTimeStamp}`)
return prizeImageRef.delete()
I keep getting the 403 error:
code : "storage/unauthorized"
Firebase Storage: User does not have permission to access
Are my rules for deletion not correct?