From 2e21c3137b2a771a36ddb1e2e6c5a7a3f6f67b92 Mon Sep 17 00:00:00 2001 From: kali Date: Thu, 14 Feb 2013 06:07:36 +0900 Subject: Fix broken login page. Close #1760 --- src/leap/gui/firstrun/login.py | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) (limited to 'src/leap/gui/firstrun/login.py') diff --git a/src/leap/gui/firstrun/login.py b/src/leap/gui/firstrun/login.py index 1efceaa9..409cb9bf 100644 --- a/src/leap/gui/firstrun/login.py +++ b/src/leap/gui/firstrun/login.py @@ -1,6 +1,8 @@ """ LogIn Page, used inf First Run Wizard """ +import logging + from PyQt4 import QtCore from PyQt4 import QtGui @@ -13,6 +15,8 @@ from leap.gui import styles from leap.gui.constants import APP_LOGO, APP_WATERMARK, FULL_USERNAME_REGEX +logger = logging.getLogger(__name__) + class LogInPage(InlineValidationPage, UserFormMixIn): # InlineValidationPage @@ -112,7 +116,9 @@ class LogInPage(InlineValidationPage, UserFormMixIn): # InlineValidationPage # page here as a mean to catch # srp authentication errors while wizard = self.wizard() - eipconfigchecker = wizard.eipconfigchecker(domain=domain) + pconfig = wizard.eipconfigchecker(domain=domain) + pconfig.defaultprovider.load() + pconfig.set_api_domain() ######################## # 1) try name resolution @@ -126,7 +132,7 @@ class LogInPage(InlineValidationPage, UserFormMixIn): # InlineValidationPage # two-by-one def resolvedomain(): try: - eipconfigchecker.fetch_definition(domain=domain) + pconfig.fetch_definition(domain=domain) # we're using requests here for all # the possible error cases that it catches. @@ -144,30 +150,29 @@ class LogInPage(InlineValidationPage, UserFormMixIn): # InlineValidationPage yield((self.tr("Resolving domain name"), 20), resolvedomain) wizard.set_providerconfig( - eipconfigchecker.defaultprovider.config) + pconfig.defaultprovider.config) ######################## # 2) do authentication ######################## credentials = username, password pCertChecker = wizard.providercertchecker( - domain=domain) + domain=domain, + apidomain=pconfig.get_api_domain()) def validate_credentials(): - ################# - # FIXME #BUG #638 - verify = False try: pCertChecker.download_new_client_cert( - credentials=credentials, - verify=verify) + credentials=credentials) except auth.SRPAuthenticationError as exc: + logger.debug('srp auth error in validate credentials step') return self.fail( self.tr("Authentication error: %s" % exc.message)) except Exception as exc: + logger.error('unknown error in validate credentials step') return self.fail(exc.message) else: -- cgit v1.2.3