Пример #1
0
def logout():
    pc = PilotClient()
    if pc.is_logged_in():
        pc.logout()
        click.echo('You have been logged out.')
    else:
        click.echo('No user logged in, no logout necessary.')
Пример #2
0
def login(refresh_tokens, force, local_server, browser):
    pc = PilotClient()
    is_logged_in = pc.is_logged_in()
    if is_logged_in and not force:
        click.echo('You are already logged in.')
        return
    elif is_logged_in and force:
        pc.logout()

    pc.login(refresh_tokens=refresh_tokens,
             no_local_server=not local_server,
             no_browser=not browser,
             force=force)
    click.echo('You have been logged in.')