1
0
mirror of https://github.com/bitwarden/web synced 2025-12-16 16:23:31 +00:00

WIP convert web vault to new identity server

This commit is contained in:
Kyle Spearrin
2017-01-28 01:19:43 -05:00
parent 3df5a9454e
commit 1fe673951b
6 changed files with 117 additions and 66 deletions

View File

@@ -1,7 +1,7 @@
angular
.module('bit.services')
.factory('apiService', function ($resource, tokenService, appSettings) {
.factory('apiService', function ($resource, tokenService, appSettings, $httpParamSerializer) {
var _service = {},
_apiUri = appSettings.apiUri;
@@ -57,5 +57,19 @@
tokenTwoFactor: { url: _apiUri + '/auth/token/two-factor', method: 'POST', params: {} }
});
_service.identity = $resource(_apiUri + '/connect', {}, {
token: {
url: _apiUri + '/connect/token',
method: 'POST',
headers: { 'Content-Type': 'application/x-www-form-urlencoded; charset=utf-8' },
transformRequest: transformUrlEncoded,
params: {}
}
});
function transformUrlEncoded(data) {
return $httpParamSerializer(data);
}
return _service;
});