Move the logout logic to the auth manager
#
#
from __future__ import annotations
import logging
from importlib import import_module
from flask import g, redirect
from flask_login import logout_user
from airflow.configuration import conf
from airflow.exceptions import AirflowConfigException, AirflowException
from airflow.www.extensions.init_auth_manager import get_auth_manager
log = logging.getLogger(__name__)
def init_xframe_protection(app):
    """
    Add X-Frame-Options header. Use it to avoid click-jacking attacks, by ensuring that their content is not
    embedded into other sites.
    See also: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Frame-Options
    """
    x_frame_enabled = conf.getboolean("webserver", "X_FRAME_ENABLED", fallback=True)
    if x_frame_enabled:
        return
    def apply_caching(response):