I'm very new to software development. I used Google login in React for the login mechanism, and store the unique Google ID for the user's id on MySQL. When success login occurs, this ID will be stored on the localStorage, so every time the user wants to get something from the database, I just pass in this ID to MySQL, this is the illustration:
// ----- Frontend ----- //
.post(URL, {id:localStorage.getItem("id")} )
// ----- Backend ----- //
id = req.body.id // Getting the id past from the frontend
// Get the items from database using this id
SELECT * FROM users WHERE user_id=id
But my problem is, what if the user opens their browser's console and changes the local storage value? This user can then access someone's information by just changing the local storage's value into something. If you know a reliable solution for this login system please let me know!