summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--pkg/requirements.pip2
-rw-r--r--src/leap/bitmask/bonafide/service.py9
2 files changed, 9 insertions, 2 deletions
diff --git a/pkg/requirements.pip b/pkg/requirements.pip
index dae27fa5..a34f8295 100644
--- a/pkg/requirements.pip
+++ b/pkg/requirements.pip
@@ -3,5 +3,5 @@ colorama
zope.interface
service-identity
gnupg
-leap.common>=0.5.4
+leap.common>=0.5.5
leap.soledad.client>=0.9.5
diff --git a/src/leap/bitmask/bonafide/service.py b/src/leap/bitmask/bonafide/service.py
index 0a78813b..0f9c6281 100644
--- a/src/leap/bitmask/bonafide/service.py
+++ b/src/leap/bitmask/bonafide/service.py
@@ -21,9 +21,10 @@ Bonafide Service.
import os
from collections import defaultdict
-from leap.common.config import get_path_prefix
from leap.bitmask.bonafide._protocol import BonafideProtocol
from leap.bitmask.hooks import HookableService
+from leap.common.config import get_path_prefix
+from leap.common.events import catalog, emit_async
from twisted.internet import defer
from twisted.logger import Logger
@@ -66,6 +67,11 @@ class BonafideService(HookableService):
self.trigger_hook('on_bonafide_auth', **data)
return result
+ def trigger_event(result):
+ _, uuid = result
+ emit_async(catalog.BONAFIDE_AUTH_DONE, uuid, username)
+ return result
+
# XXX I still have doubts from where it's best to trigger this.
# We probably should wait for BOTH deferreds and
# handle local and remote authentication success together
@@ -76,6 +82,7 @@ class BonafideService(HookableService):
d = self._bonafide.do_authenticate(username, password, autoconf)
d.addCallback(notify_bonafide_auth)
+ d.addCallback(trigger_event)
d.addCallback(lambda response: {
'srp_token': response[0], 'uuid': response[1]})
return d