DEV Community

Discussion on: AWS Amplify Storage: React example for Avatar pictures

Collapse
 
mattdwebb profile image
Matt D. Webb

Isn't Storage.get("profilePicture.png") just generic? So any other user logging in will pull this same storage item?

What is the method for making this unique to the authenticated user?

Collapse
 
mattdwebb profile image
Matt D. Webb • Edited

I would assume something like the following:

const { id } = await Auth.currentUserInfo();
Storage.put(`${id}-avatar.png`, ...);

Also, there maybe some issues with the .configure({ level: "private" }); I have seen some 403 permission denied which is discussed here GitHub Issue: Amplify S3 404

Collapse
 
johanneskonings profile image
Johannes Konings

Hi, it's unique through the level "private" via this command Storage.configure({ track: true, level: "private" });

docs.amplify.aws/lib/storage/confi...

So far I had no 403 permission denied.