code: def log_used_nonce(self, username, iat, nonce):
          
          # TODO: Figure out some way to do this in a thread-safe manner. It'd be better to use
          # a Redis Set or something, but we don't necessarily want to be tightly coupled to
          # Redis either since not everyone uses it.
          key = self.create_nonce_key(username, iat)
          used = cache.get(key, [])
          used.append(nonce)
          cache.set(key, set(used), token.TIMESTAMP_TOLERANCE * 2)
docs: Log a nonce as being used, and therefore henceforth invalid.
  
          :param username: Username as a string.
          :param iat: Unix timestamp float or integer of when the nonce was used.
          :param nonce: Nonce value.