I started learning Angular and I noticed that every call I make to backend can be seen from developer tool. So when I got method/function like this:
getUser(userId){
return this.http.post('server/page/get-user', {id:userId});
}
And then in some component I would call it like this:
this.userService.getUser(2).subscribe((data)=> {
console.log(data)
})
What basically returns user information (name, address etc), based on what user id gets posted. If one wanted to get random user information, couldn't they just make API call to this endpoint, with random number in request payload and just get that user information?
I read something that one way to fix this is to use JWT, what basically encrypts the payloads, but isn't there option to like turn this api call usable only in my app? or make it at least hidden from developers tools?