def _handleAuth(fn):
@functools.wraps(fn)<EOL>def wrapped(*args, **kwargs):<EOL><INDENT>from yotta.lib import auth<EOL>interactive = globalconf.get('<STR_LIT>')<EOL>try:<EOL><INDENT>return fn(*args, **kwargs)<EOL><DEDENT>except requests.exceptions.HTTPError as e:<EOL><INDENT>if e.response.status_code == requests.codes.unauthorized: <EOL><INDENT>logger.debug('<STR_LIT>', fn)<EOL>auth.authorizeUser(provider=None, interactive=interactive)<EOL>if interactive:<EOL><INDENT>logger.debug('<STR_LIT>')<EOL>return fn(*args, **kwargs)<EOL><DEDENT><DEDENT>raise<EOL><DEDENT><DEDENT>return wrapped<EOL>
Decorator to re-try API calls after asking the user for authentication.