diff options
Diffstat (limited to 'service/pixelated')
-rw-r--r-- | service/pixelated/application.py | 10 | ||||
-rw-r--r-- | service/pixelated/bitmask_libraries/soledad.py | 6 |
2 files changed, 10 insertions, 6 deletions
diff --git a/service/pixelated/application.py b/service/pixelated/application.py index 1194a1a8..8502d5d1 100644 --- a/service/pixelated/application.py +++ b/service/pixelated/application.py @@ -28,6 +28,11 @@ from pixelated.config.site import PixelatedSite from pixelated.resources.loading_page import LoadingResource from pixelated.resources.root_resource import RootResource +from leap.common.events import ( + register, + catalog as events +) + @defer.inlineCallbacks def start_user_agent(loading_app, host, port, sslkey, sslcert, leap_home, leap_session): @@ -95,6 +100,11 @@ def initialize(): failure.printTraceback() reactor.stop() + def _register_shutdown_on_token_expire(leap_session): + register(events.SOLEDAD_INVALID_AUTH_TOKEN, lambda _: reactor.stop()) + return leap_session + + deferred.add_callback(_register_shutdown_on_token_expire) deferred.addErrback(_quit_on_error) reactor.run() diff --git a/service/pixelated/bitmask_libraries/soledad.py b/service/pixelated/bitmask_libraries/soledad.py index 84f9c3a3..0546a158 100644 --- a/service/pixelated/bitmask_libraries/soledad.py +++ b/service/pixelated/bitmask_libraries/soledad.py @@ -16,11 +16,6 @@ import errno import os -from twisted.internet import reactor -from leap.common.events import ( - register, - catalog as events -) from leap.soledad.client import Soledad from leap.soledad.common.crypto import WrongMacError, UnknownMacMethodError from pixelated.bitmask_libraries.certs import LeapCertificate @@ -47,7 +42,6 @@ class SoledadSessionFactory(object): class SoledadSession(object): def __init__(self, provider, encryption_passphrase, user_token, user_uuid): - register(events.SOLEDAD_INVALID_AUTH_TOKEN, lambda _: reactor.stop()) self.provider = provider self.config = provider.config self.user_uuid = user_uuid |