Skip to content

Commit

Permalink
Fix issue #241 by checking the provided password. Errors now make gpl…
Browse files Browse the repository at this point in the history
…aycli exits.
  • Loading branch information
matlink committed Feb 18, 2020
1 parent 5ac22a6 commit b601a55
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
3 changes: 3 additions & 0 deletions gplaycli/gplaycli.py
Original file line number Diff line number Diff line change
Expand Up @@ -422,6 +422,9 @@ def connect_credentials(self):
elif self.keyring_service and not HAVE_KEYRING:
logger.error("You asked for keyring service but keyring package is not installed")
return False, ERRORS.KEYRING_NOT_INSTALLED
else:
logger.error("No password found. Check your configuration file.")
return False, ERRORS.CANNOT_LOGIN_GPLAY
try:
self.api.login(email=self.gmail_address, password=password)
except LoginError as e:
Expand Down
4 changes: 3 additions & 1 deletion gplaycli/hooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ def connected(function):
"""
def check_connection(self, *args, **kwargs):
if self.api is None or self.api.authSubToken is None:
self.connect()
ok, err = self.connect()
if not ok:
exit(err)
return function(self, *args, **kwargs)
return check_connection

0 comments on commit b601a55

Please sign in to comment.