code: def check_auth() -> bool:
      """checking whether current user is authenticated
  
      Returns:
          bool: True if user authentication is approved
      """
      config = Config()
      if config["auth"]["http_auth_enabled"] is False:
          return True
  
      if config["auth"].get("provider") == "cloud":
          if isinstance(session.get("username"), str) is False:
              return False
  
          if (
              config["auth"]["oauth"]["tokens"]["expires_at"]
              < time.time()
          ):
              return False
  
          return True
  
      return session.get("username") == config["auth"]["username"]
  
file_path: mindsdb/mindsdb/api/http/namespaces/default.py
imports: import time
  from flask import request, session
  from flask_restx import Resource
  from flask_restx import fields
  from mindsdb.__about__ import __version__
  from mindsdb.api.http.namespaces.configs.default import ns_conf
  from mindsdb.api.http.utils import http_error
  from mindsdb.utilities.config import Config
  from mindsdb.utilities import log
label_desc: Use image node_id 1 for calling a global function with example usage: check_auth() and returns: unknown, True, True, False, False