@obelisk/client
Advanced tools
Comparing version 2.3.0 to 2.3.1
@@ -132,15 +132,21 @@ "use strict"; | ||
return ajax_1.ajax.post(tokenUrl, params, headers).pipe(operators_1.flatMap(resp => { | ||
const authResponse = resp.response; | ||
const pat = new auth_1.Token(authResponse.access_token); | ||
const patRefresh = new auth_1.Token(authResponse.refresh_token); | ||
const idtok = new auth_1.Token(authResponse.id_token); | ||
// store in memory | ||
this._tokens.pat = pat; | ||
this._tokens.patRefresh = patRefresh; | ||
this._tokens.idtoken = idtok; | ||
// store logged in + expiration | ||
this._storage.add('logInfo', { authenticated: true, expires: pat.getExpiresAt() }); | ||
// this.scheduleTokenRefresh(pat, patRefresh); | ||
this.authOver$.next(); | ||
return rxjs_1.of(true); | ||
if (resp.status >= 400) { | ||
this.clearClientCredentials(); | ||
return rxjs_1.of(false); | ||
} | ||
else { | ||
const authResponse = resp.response; | ||
const pat = new auth_1.Token(authResponse.access_token); | ||
const patRefresh = new auth_1.Token(authResponse.refresh_token); | ||
const idtok = new auth_1.Token(authResponse.id_token); | ||
// store in memory | ||
this._tokens.pat = pat; | ||
this._tokens.patRefresh = patRefresh; | ||
this._tokens.idtoken = idtok; | ||
// store logged in + expiration | ||
this._storage.add('logInfo', { authenticated: true, expires: pat.getExpiresAt() }); | ||
// this.scheduleTokenRefresh(pat, patRefresh); | ||
this.authOver$.next(); | ||
return rxjs_1.of(true); | ||
} | ||
}), operators_1.switchMap(() => this.getNewRpt())); | ||
@@ -147,0 +153,0 @@ } |
{ | ||
"name": "@obelisk/client", | ||
"version": "2.3.0", | ||
"version": "2.3.1", | ||
"description": "Typescript client to interact with Obelisk on a higher level than the regular ReST API calls.", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
102817
2719