summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTomas Touceda <chiiph@leap.se>2013-04-10 09:56:36 -0300
committerTomas Touceda <chiiph@leap.se>2013-04-11 16:02:14 -0300
commitfd17db8aaeda0c5997a608fd2d2e0392eb0c68ae (patch)
treea96e6c675b08d583a50228dbe2946dbd338384a4 /src
parente0032a6c97b3ed766698521c76bc37d0655f4277 (diff)
Emit session_id and uid through events
Diffstat (limited to 'src')
-rw-r--r--src/leap/crypto/srpauth.py11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/leap/crypto/srpauth.py b/src/leap/crypto/srpauth.py
index 8028a6dc..ba8ac3f5 100644
--- a/src/leap/crypto/srpauth.py
+++ b/src/leap/crypto/srpauth.py
@@ -26,6 +26,8 @@ from PySide import QtCore, QtGui
from leap.common.check import leap_assert
from leap.config.providerconfig import ProviderConfig
from leap.util.checkerthread import CheckerThread
+from leap.common.events import signal as events_signal
+from leap.common.events import events_pb2 as proto
logger = logging.getLogger(__name__)
@@ -237,7 +239,11 @@ class SRPAuth(QtCore.QObject):
(auth_result.status_code,))
M2 = auth_result.json().get("M2", None)
- self.set_uid(auth_result.json().get("id", None))
+ uid = auth_result.json().get("id", None)
+
+ events_signal(proto.CLIENT_UID, content=uid)
+
+ self.set_uid(uid)
if M2 is None or self.get_uid() is None:
logger.error("Something went wrong. Content = %r" %
@@ -279,6 +285,9 @@ class SRPAuth(QtCore.QObject):
raise SRPAuthenticationError(self.tr("Session cookie "
"verification "
"failed"))
+
+ events_signal(proto.CLIENT_SESSION_ID, content=session_id)
+
self.set_session_id(session_id)
def authenticate(self, username, password):