code: def init_check_user_active(app):
      @app.before_request
      def check_user_active():
          url_logout = get_auth_manager().get_url_logout()
          if request.path == url_logout:
              return
          if (
              get_auth_manager().is_logged_in()
              and not get_auth_manager().get_user().is_active
          ):
              return redirect(url_logout)
  
file_path: airflow/airflow/www/extensions/init_security.py
imports: from __future__ import annotations
  import logging
  from importlib import import_module
  from flask import redirect, request
  from airflow.configuration import conf
  from airflow.exceptions import AirflowConfigException, AirflowException
  from airflow.www.extensions.init_auth_manager import get_auth_manager
label_desc: Use image node_id 3 for calling a global function with example usage: init_check_user_active(app) and returns: redirect