raise error when required username or password are missing

do not try to login as 'None' (#1192)
This commit is contained in:
Mike Fährmann
2020-12-22 14:40:18 +01:00
parent b233531aaa
commit b58e605dc7
3 changed files with 13 additions and 1 deletions

View File

@@ -522,6 +522,10 @@ class PixivAppAPI():
@cache(maxage=3600, keyarg=1)
def _login_impl(self, username, password):
if not username or not password:
raise exception.AuthenticationError(
"Username and password required")
url = "https://oauth.secure.pixiv.net/auth/token"
data = {
"client_id": self.client_id,