I'm new to React and I have taken some courses online. Can users change the state/props of components on a React app in production using console or react tools? My question is more related to security.
i.e. changing login credentials to access data that should not be accessible to them.
In PHP I would control this by storing users credentials in a session and then validating it using a middleware in backend. Since users have full control of what is on client-side, how could I prevent someone from changing credentials and access sensitive data?
EDIT: My approach would be to validade the credentials on backend and then store user data in a state, lets say in a state property called userId:
//after backend validation
if (credentialsAreValid) {
this.setState({userId})
}
How could I prevent a user to modify its ID which is stored in the state?