1
0
mirror of https://github.com/bitwarden/browser.git synced 2024-10-19 07:35:48 +02:00
bitwarden-browser/src/services/apiService.js

21 lines
579 B
JavaScript
Raw Normal View History

2016-09-03 06:38:27 +02:00
function ApiService(tokenService) {
this.baseUrl = 'https://api.bitwarden.com';
this.tokenService = tokenService;
};
!function () {
ApiService.prototype.getProfile = function (success, error) {
var self = this;
this.tokenService.getToken(function(token) {
$.ajax({
type: 'GET',
url: self.baseUrl + '/accounts/profile',
data: 'access_token=' + token,
dataType: 'json',
success: success,
error: error
});
});
};
}();