[Vuejs]-Retrieving user data securely when user authenticates

0👍

There isn’t anything you can do to prevent client side DOM manipulation. If it’s accessible via JavaScript, it’s accessible to the user. It’s up to you to implement your application in such a way that sensitive information and/or functionality is not dependent on client side security (if such a thing truly exists).

What you can do is prevent unauthorized access on the server. This is the purpose of defining scopes, ACLs, etc. If a savvy user does modify the response data and, say, change their role from user to admin, your response should not contain anything meant for admin users only. Rather, that information should only be accessible after making a successful API call where your server code has authenticated/authorized the request.

Never trust the client when it comes to security. That must be done on the server.

Leave a comment