Hello, This is my utility function for obtaining the users' avatar url.
Is this a safe approach to the problem? I am also unsure about ending the url with &mode=admin. The issue is, without &mode=admin, it doesn't load the avatars.
export const getAvatarUrl = (avatarId) => {
if (!avatarId) return null;
const url = `${import.meta.env.VITE_ENDPOINT}/storage/buckets/${import.meta.env.VITE_AVATAR_BUCKET}/files/${avatarId}/view?project=${import.meta.env.VITE_PROJECT}&mode=admin`;
return url;
};
Safe Approach to Bucket
mode admin only works for your console session, it will not work for other people. if you want to share this image with others you need to either allowing from your bucket or file permissions depending on which security model you're using
Recommended threads
- Type 'Theme' does not satisfy the constr...
Type 'Theme' does not satisfy the constraint 'Row'. Type 'Theme' is missing the following properties from type 'Row': $id, $sequence, $tableId, $databaseId, a...
- Custom Domain TLS Error (perfinso.com)
Hey Appwrite team/community, I need urgent help with a custom domain setup! I've added perfinso.com to my project, pointed the nameservers, and verification is...
- User unable to delete document they crea...
I am having a bit a database issue. I am making a music review website and I have successfully been able to create and update reviews as a dummy user, but no ma...