diff --git a/src/blueapi/service/authentication.py b/src/blueapi/service/authentication.py index c0a32b26f..488fdf26c 100644 --- a/src/blueapi/service/authentication.py +++ b/src/blueapi/service/authentication.py @@ -52,6 +52,8 @@ def save_cache(self, cache: Cache) -> None: os.chmod(self._file_path, 0o600) def load_cache(self) -> Cache: + Path(self._file_path).mkdir(parents=True, exist_ok=True) + os.chmod(self._file_path, 0o600) with open(self._file_path, "rb") as cache_file: return TypeAdapter(Cache).validate_json( base64.b64decode(cache_file.read()).decode("utf-8")