I am currently working on a coding issue that involves the security of user profiles. While it doesn't involve sensitive information like payment details or personal data, it does pertain to the ownership of a profile.
Currently, I store users' basic information (such as name, email, bio, etc) on Firebase and display it publicly on their profile. To ensure that only the actual owner can edit their profile, I use a simple if function.
if(this.userInfo.user_slug == this.$route.params.id && this.user)
If this condition is met, I grant the user editing privileges. However, I am concerned that this method may be vulnerable to exploitation. Is it possible for someone to manipulate this setting and gain unauthorized access to editing profiles? If so, what is the most effective and straightforward way to ensure that only the profile owner can make edits when logged in?
Any advice or suggestions would be greatly appreciated!