diff options
author | Thais Siqueira <thais.siqueira@gmail.com> | 2017-03-31 14:10:30 -0300 |
---|---|---|
committer | Thais Siqueira <thais.siqueira@gmail.com> | 2017-03-31 14:10:30 -0300 |
commit | f4229e63e315654032dc3f0c8a69e2892c72758c (patch) | |
tree | 03f18be9252afc70257ff5b62c345153241140dd /service/pixelated/resources | |
parent | ed6c3c449b7a947901b45bdb0d0dc017560e7f78 (diff) |
[#927] Implements sending recovery code by email.
with @tayanefernandes
Diffstat (limited to 'service/pixelated/resources')
-rw-r--r-- | service/pixelated/resources/__init__.py | 3 | ||||
-rw-r--r-- | service/pixelated/resources/backup_account_resource.py | 4 |
2 files changed, 6 insertions, 1 deletions
diff --git a/service/pixelated/resources/__init__.py b/service/pixelated/resources/__init__.py index 61e60720..3b2a7118 100644 --- a/service/pixelated/resources/__init__.py +++ b/service/pixelated/resources/__init__.py @@ -122,6 +122,9 @@ class BaseResource(Resource): def soledad(self, request): return self._service(request, '_leap_session').soledad + def get_backup_email(self, request): + return json.loads(request.content.getvalue()).get('backupEmail') + class UnAuthorizedResource(Resource): diff --git a/service/pixelated/resources/backup_account_resource.py b/service/pixelated/resources/backup_account_resource.py index b752b4c7..677e9e75 100644 --- a/service/pixelated/resources/backup_account_resource.py +++ b/service/pixelated/resources/backup_account_resource.py @@ -51,7 +51,9 @@ class BackupAccountResource(BaseResource): def render_POST(self, request): account_recovery = AccountRecovery( self._authenticator.bonafide_session, - self.soledad(request)) + self.soledad(request), + self._service(request, '_leap_session').smtp_config, + self.get_backup_email(request)) def update_response(response): request.setResponseCode(NO_CONTENT) |