Move the logout logic to the auth manager
@dont_initialize_flask_app_submodules(
        skip_all_except=[
            "init_api_connexion",
            "init_appbuilder",
            "init_appbuilder_links",
            "init_appbuilder_views",
            "init_flash_views",
            "init_jinja_globals",
            "init_plugins",
            "init_airflow_session_interface",
        ]
    )
    def poorly_configured_app_factory():
        with conf_vars({("webserver", "session_backend"): "invalid_value_for_session_backend"}):
            return app.create_app(testing=True)
    expected_exc_regex = (
        "^Unrecognized session backend specified in web_server_session_backend: "
        r"'invalid_value_for_session_backend'\. Please set this to .+\.$"
    )
    with pytest.raises(AirflowConfigException, match=expected_exc_regex):
        poorly_configured_app_factory()
def test_session_id_rotates(app, user_client):