From af27100e35f30f91f3c8f3eb4b8fcef978d11eae Mon Sep 17 00:00:00 2001 From: "Kali Kaneko (leap communications)" Date: Mon, 3 Oct 2016 17:40:09 -0400 Subject: [feature] handle invite codes In the command line, --invitecode is a new optional parameter to the command "user create". bonafide service handles the invite codes. javascript library should be updated accordingly - Resolves: #7550 --- src/leap/bitmask/bonafide/_protocol.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/leap/bitmask/bonafide/_protocol.py') diff --git a/src/leap/bitmask/bonafide/_protocol.py b/src/leap/bitmask/bonafide/_protocol.py index 3572cbf..1112550 100644 --- a/src/leap/bitmask/bonafide/_protocol.py +++ b/src/leap/bitmask/bonafide/_protocol.py @@ -77,16 +77,16 @@ class BonafideProtocol(object): # Service public methods - def do_signup(self, full_id, password, autoconf=False): + def do_signup(self, full_id, password, invite=None, autoconf=False): log.msg('SIGNUP for %s' % full_id) _, provider_id = config.get_username_and_provider(full_id) provider = config.Provider(provider_id, autoconf=autoconf) d = provider.callWhenReady( - self._do_signup, provider, full_id, password) + self._do_signup, provider, full_id, password, invite) return d - def _do_signup(self, provider, full_id, password): + def _do_signup(self, provider, full_id, password, invite): # XXX check it's unauthenticated def return_user(result, _session): @@ -97,7 +97,7 @@ class BonafideProtocol(object): username, _ = config.get_username_and_provider(full_id) # XXX get deferred? session = self._get_session(provider, full_id, password) - d = session.signup(username, password) + d = session.signup(username, password, invite) d.addCallback(return_user, session) d.addErrback(self._del_session_errback, full_id) return d -- cgit v1.2.3