Skip to content

Commit

Permalink
Merge pull request #137 from mckayward/feature/prompt-for-password
Browse files Browse the repository at this point in the history
prompt for password if flag not passed
  • Loading branch information
narenst authored Nov 20, 2017
2 parents 19bac48 + b88df67 commit 8dbef8d
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions floyd/cli/auth.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import click
import webbrowser
import sys

import floyd
from floyd.client.auth import AuthClient
Expand All @@ -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)
Expand Down

0 comments on commit 8dbef8d

Please sign in to comment.