def __getattr__(name):  # type: ignore
    """Module-level getattr to handle automatic authentication when accessing
    `earthaccess.__auth__` and `earthaccess.__store__`.

    Other unhandled attributes raise as `AttributeError` as expected.
    """
    global _auth, _store

    if name not in ["__auth__", "__store__"]:
        raise AttributeError(f"module {__name__!r} has no attribute {name!r}")

    with _lock:
        if not _auth.authenticated:
            for strategy in ["environment", "netrc"]:
                try:
                    _auth.login(strategy=strategy)

                    if _auth.authenticated:
                        _store = Store(_auth)
                        logger.debug(
                            f"Automatic authentication with {strategy=} was successful"
                        )
                        break
                except Exception as e:
                    logger.debug(
                        f"An error occurred during automatic authentication with {strategy=}: {str(e)}"
                    )

        return _auth if name == "__auth__" else _store
Module-level getattr to handle automatic authentication when accessing
    `earthaccess.__auth__` and `earthaccess.__store__`.

    Other unhandled attributes raise as `AttributeError` as expected.
    
earthaccess/__init__.py