1
0
mirror of https://github.com/bitwarden/browser.git synced 2024-12-25 16:59:17 +01:00

pass self to helper

This commit is contained in:
Kyle Spearrin 2017-01-21 22:07:08 -05:00
parent 4968a00dcf
commit ca6de7d9ec

View File

@ -342,7 +342,7 @@ function initApiService() {
self.tokenService.getToken(function (accessToken) {
// handle transferring from old auth bearer
if (authBearer && !accessToken) {
postConnectToken({
postConnectToken(self, {
grant_type: 'password',
oldAuthBearer: authBearer,
scope: 'api offline_access',
@ -364,7 +364,7 @@ function initApiService() {
return;
}
postConnectToken({
postConnectToken(self, {
grant_type: 'refresh_token',
client_id: 'browser',
refresh_token: refreshToken
@ -390,7 +390,7 @@ function initApiService() {
return deferred.promise
}
function postConnectToken(data, success, error) {
function postConnectToken(self, data, success, error) {
$.ajax({
type: 'POST',
url: self.baseUrl + '/connect/token',