+ # Delay upon second request within time window
+ if now - user_content["_admin"].get("last_token_time", 0) < self.token_time_window:
+ sleep(self.token_delay)
+ # user_content["_admin"]["last_token_time"] = now
+ # self.db.replace("users", user_content["_id"], user_content) # might cause race conditions
+ self.db.set_one("users", {"_id": user_content["_id"]}, {"_admin.last_token_time": now})
+