title: How to prevent user from posting multiple times?
body: <p>I've got an app where users are only allowed to make a post once every five minutes. </p>
  
  <p>I'm trying to figure out how exactly is the safest way to prevent a user from posting more than once in this five minute span.</p>
  
  <p>The first solution I came up with was running a check against a lastPostTimestamp value that is updated when a user makes a post.</p>
  
  <p>The problem I found with this potentially is if someone's internet is amazingly slow or laggy, a user could potentially just spam the button twice before the timestamp is updated on Firebase and get two posts in.</p>
  
  <p>The route then is to create local variables and timers set to 5 minutes and check both firebase and the local variable but that just all seems messy and weird to be checking both a local if it exists and firebase if it exists.</p>
  
  <p>I can't use UserDefaults incase a user switches devices.</p>
  
  <p>Any ideas for how to smoothly check to make sure a user hasn't sent off information to Firebase in the last 5 minutes? </p>