Reputation: 2246
Meteor beginner, tearing my hair out about this one...
I have a meteor web app (a little game) where I would like to disable everything client-side while I manually update the database and run some checks. So, for a very short space of time, I just need to disable anything coming from my users and render a template that says "Game scores are being updated, come back later etc. etc."
My first thought was just to have this template based on something like Session.set("serverUpdating", true)
but then that's something that could just be reset by anyone in their browser, right?
What is the best way to achieve what I want, securely? Any guidance much appreciated!
Upvotes: 0
Views: 69
Reputation: 20246
One way would be to create an admin collection that contains this state information. Publish it to all clients and have your master layout or router use it to switch to a maintenance page when it's set. Make sure you have deny rules setup to avoid any clients modifying it. Then when you want to go into maintenance just use the mongo console to update that collection and revert when you're done.
Upvotes: 1