summaryrefslogtreecommitdiff
path: root/src/leap/bitmask/bonafide/service.py
diff options
context:
space:
mode:
authorRuben Pollan <meskio@sindominio.net>2016-09-27 19:28:28 -0500
committerRuben Pollan <meskio@sindominio.net>2016-09-28 17:23:37 -0500
commit2fc85ad7d109ca4304d1fb1515b7087a1bb2ae3e (patch)
treef3627d5b9fd613dad05aa416df7d445fde02e0ae /src/leap/bitmask/bonafide/service.py
parent1aa1ffde9613435fe95434ead4909ea081d0c3c9 (diff)
[feature]Add change password command
- Resolves: #8487
Diffstat (limited to 'src/leap/bitmask/bonafide/service.py')
-rw-r--r--src/leap/bitmask/bonafide/service.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/leap/bitmask/bonafide/service.py b/src/leap/bitmask/bonafide/service.py
index 5e3b0f1..797e606 100644
--- a/src/leap/bitmask/bonafide/service.py
+++ b/src/leap/bitmask/bonafide/service.py
@@ -103,6 +103,17 @@ class BonafideService(HookableService):
d.addCallback(lambda response: {'logout': 'ok'})
return d
+ def do_change_password(self, username, current_password, new_password):
+ def notify_passphrase_change(_):
+ data = dict(username=username, password=new_password)
+ self.trigger_hook('on_passphrase_change', **data)
+
+ d = self._bonafide.do_change_password(username, current_password,
+ new_password)
+ d.addCallback(notify_passphrase_change)
+ d.addCallback(lambda _: {'update': 'ok'})
+ return d
+
def do_provider_create(self, domain):
return self._bonafide.do_get_provider(domain, autoconf=True)