1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-13 06:43:35 +00:00

get private key if not available during sync

This commit is contained in:
Kyle Spearrin
2017-04-25 16:23:37 -04:00
parent f04908058f
commit 154427a0f3
3 changed files with 55 additions and 5 deletions

View File

@@ -1,8 +1,8 @@
function ApiService(tokenService, appIdService, utilsService, logoutCallback) {
this.baseUrl = 'http://localhost:4000'; // Desktop
//this.baseUrl = 'http://localhost:4000'; // Desktop
//this.baseUrl = 'http://192.168.1.8:4000'; // Desktop external
//this.baseUrl = 'https://preview-api.bitwarden.com'; // Preview
//this.baseUrl = 'https://api.bitwarden.com'; // Production
this.baseUrl = 'https://api.bitwarden.com'; // Production
this.tokenService = tokenService;
this.logoutCallback = logoutCallback;
this.appIdService = appIdService;
@@ -78,6 +78,25 @@ function initApiService() {
});
};
ApiService.prototype.getKeys = function (success, error) {
var self = this;
handleTokenState(self).then(function (token) {
$.ajax({
type: 'GET',
url: self.baseUrl + '/accounts/keys?access_token2=' + token,
dataType: 'json',
success: function (response) {
success(new KeysResponse(response));
},
error: function (jqXHR, textStatus, errorThrown) {
handleError(error, jqXHR, false, self);
}
});
}, function (jqXHR) {
handleError(error, jqXHR, true, self);
});
};
ApiService.prototype.postPasswordHint = function (request, success, error) {
var self = this;
$.ajax({