Fix login
This commit is contained in:
3
.gitignore
vendored
3
.gitignore
vendored
@@ -1,4 +1,5 @@
|
||||
.venv
|
||||
corenetworks-credentials.ini
|
||||
.python-version
|
||||
**.pyc
|
||||
**.pyc
|
||||
certbot-test
|
||||
Binary file not shown.
@@ -62,7 +62,9 @@ class Authenticator(dns_common.DNSAuthenticator):
|
||||
|
||||
def _get_corenetworks_client(self):
|
||||
return _CoreNetworksAPIClient(
|
||||
self.credentials.conf("login"), self.credentials.conf("password"), self.ttl
|
||||
self.credentials.conf("username"),
|
||||
self.credentials.conf("password"),
|
||||
self.ttl,
|
||||
)
|
||||
|
||||
|
||||
@@ -71,8 +73,8 @@ class _CoreNetworksAPIClient:
|
||||
Encapsulates all communication with the Core Networks API.
|
||||
"""
|
||||
|
||||
def __init__(self, login, password, ttl):
|
||||
self.login = login
|
||||
def __init__(self, username, password, ttl):
|
||||
self.username = username
|
||||
self.password = password
|
||||
self.ttl = ttl
|
||||
self.token = None
|
||||
@@ -83,9 +85,11 @@ class _CoreNetworksAPIClient:
|
||||
return self.token
|
||||
|
||||
try:
|
||||
print(self.username)
|
||||
print(self.password)
|
||||
response = requests.post(
|
||||
f"{API_BASE_URL}/auth/token",
|
||||
json={"login": self.login, "password": self.password},
|
||||
json={"login": self.username, "password": self.password},
|
||||
timeout=30,
|
||||
)
|
||||
response.raise_for_status()
|
||||
|
||||
Binary file not shown.
Reference in New Issue
Block a user