From b88df67ceec6a5fcab775a69fc52ecebf1f85276 Mon Sep 17 00:00:00 2001 From: McKay Ward Date: Mon, 20 Nov 2017 12:18:38 -0700 Subject: [PATCH] prompt for password if flag not passed --- floyd/cli/auth.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/floyd/cli/auth.py b/floyd/cli/auth.py index d6ed5d8..a33e89a 100644 --- a/floyd/cli/auth.py +++ b/floyd/cli/auth.py @@ -1,5 +1,6 @@ import click import webbrowser +import sys import floyd from floyd.client.auth import AuthClient @@ -20,8 +21,11 @@ def login(token, username, password): if username: # Use username / password login if not password: - floyd_logger.info("Missing --password field") - return + password = click.prompt('Please enter your password', type=str, hide_input=True) + password = password.strip() + if not password: + floyd_logger.info('You entered an empty string. Please make sure you enter your password correctly.') + sys.exit(1) login_credentials = Credentials(username=username, password=password)