Move the logout logic to the auth manager
#
#
from __future__ import annotations
from functools import wraps
from typing import Callable, Sequence, TypeVar, cast
from flask import current_app, flash, g, redirect, render_template, request
from airflow.configuration import conf
from airflow.utils.net import get_hostname
from airflow.www.extensions.init_auth_manager import get_auth_manager
T = TypeVar("T", bound=Callable)
def has_access(permissions: Sequence[tuple[str, str]] | None = None) -> Callable[[T], T]:
    """Factory for decorator that checks current user's permissions against required permissions."""
    def requires_access_decorator(func: T):
        @wraps(func)
        def decorated(*args, **kwargs):