code: def auth_required(self, view):
          
  
          @functools.wraps(view)
          def decorated(*args, **kwargs):
              log.info("Trying to get access to protected resource: '%s'", view.__name__)
              if request.method == 'POST':
                  token = request.form['token']
                  if self.development or self.authenticated(token):
                      return view(*args, **kwargs)
                  else:
                      log.warning("User has not been authorized to get access to resource: %s", view.__name__)
              else:
                  log.warning("Bad request type! Expected 'POST', actual '%s'", request.method)
  
              return abort(403)
  
          return decorated
docs: Decorator which checks if user is authenticated
          
          Decorator for Flask's view which blocks not authenticated requests
  
          :param view: Flask's view function