diff --git a/util.py b/util.py index 3b35ffc..352ed57 100644 --- a/util.py +++ b/util.py @@ -1,5 +1,6 @@ import shutil import textwrap +from commands.login import login from typing import Any, Callable from config import Config @@ -25,8 +26,9 @@ def print_wrap(text: str, indent: str = '', end: str = '\n') -> None: def require_login(function: Callable) -> Callable: def wrapper(*args: Any, **kwargs: Any) -> Any: - while 'api_token' not in Config['user']: + if 'api_token' not in Config['user']: print('Not logged in. Please use the login command to log in.') + return return function(*args, **kwargs)