Skip to content

Commit

Permalink
feat: I was removed the exception to add a validation best
Browse files Browse the repository at this point in the history
  • Loading branch information
calenzo committed Mar 22, 2023
1 parent 093ff39 commit 6730014
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/balance_nubank/utils/certificate_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@ def __init__(self, login, password, device_id, encrypted_code=None):
discovery = Discovery(HttpClient())
self.url = discovery.get_app_url('gen_certificate')

def request_code(self) -> str:
def request_code(self) -> dict:
response = requests.post(self.url, json=self._get_payload())

print('balance_nubank ->', response.json())

if response.status_code != 401 or not response.headers.get('WWW-Authenticate'):
raise NuException('Authentication code request failed.')
response_json = response.json()
return response_json["error"]

parsed = self._parse_authenticate_headers(response.headers.get('WWW-Authenticate'))
self.encrypted_code = parsed.get('device-authorization_encrypted-code')
Expand Down

0 comments on commit 6730014

Please sign in to comment.