As others have pointed out, Meteor.call can certainly be used from the console. The subtle issue here is that there may be a legitimate user of the meteorite application, which in turn can do bad things on the server. Therefore, even if you check on the server if the user is legal, this alone does not guarantee that the data is protected.
This is not a problem only with the Meteor. I think that all such applications will have to potentially protect their data from corruption, even through legitimate users.
One way to protect this distortion is to use IIFE (Expression Exited Function Expression)
Wrap your module in IIFE. A personal variable is stored inside the lock, in which a unique key of use time (k1) is stored. This key should be placed there using a different route — perhaps by ensuring that the collection observer is launched in the client at startup. Other strategies can be used here. The idea is for the protein in the k1 value from the server and put it in a private variable
Then each time you call Meteor.call from within the code, pass k1 as one of the parameters. The server, in turn, checks to see if k1 is legitimate for this browser connection.
Since k1 was stored inside a private variable in the closure that was called by IIFE, it would be difficult for someone in the browser console to determine the value of k1. Therefore, although "Meteor.call" can indeed be called from the browser console, this does not harm. This approach should be a pretty good deterrent for data corruption.
source share