summaryrefslogtreecommitdiff
path: root/src/leap/bitmask/bonafide/_protocol.py
diff options
context:
space:
mode:
authorKali Kaneko (leap communications) <kali@leap.se>2016-10-03 17:40:09 -0400
committerKali Kaneko (leap communications) <kali@leap.se>2016-10-04 11:48:30 -0400
commitaf27100e35f30f91f3c8f3eb4b8fcef978d11eae (patch)
tree92e1bdb9ebdb8e00aa84dbfefbda1b75e6cb883c /src/leap/bitmask/bonafide/_protocol.py
parentff3ed1e9418eab21fd42bb5ddd96a3851a25801c (diff)
[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
Diffstat (limited to 'src/leap/bitmask/bonafide/_protocol.py')
-rw-r--r--src/leap/bitmask/bonafide/_protocol.py8
1 files changed, 4 insertions, 4 deletions
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