@esolve/ng-esolve-connect 0.27.6 → 0.28.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm2020/lib/account/esolve-account.service.mjs +19 -2
- package/esm2020/lib/auth/esolve-auth.service.mjs +5 -5
- package/fesm2015/esolve-ng-esolve-connect.mjs +21 -4
- package/fesm2015/esolve-ng-esolve-connect.mjs.map +1 -1
- package/fesm2020/esolve-ng-esolve-connect.mjs +21 -4
- package/fesm2020/esolve-ng-esolve-connect.mjs.map +1 -1
- package/lib/account/esolve-account.service.d.ts +1 -0
- package/package.json +1 -1
|
@@ -5,7 +5,7 @@ import * as i1$2 from '@angular/common/http';
|
|
|
5
5
|
import { HTTP_INTERCEPTORS, HttpClientModule, HttpErrorResponse, HttpParams, HttpHeaders } from '@angular/common/http';
|
|
6
6
|
import * as i1 from 'ngx-cookie-service';
|
|
7
7
|
import { CookieService } from 'ngx-cookie-service';
|
|
8
|
-
import { BehaviorSubject, throwError, of,
|
|
8
|
+
import { BehaviorSubject, throwError, of, firstValueFrom, Subject, iif } from 'rxjs';
|
|
9
9
|
import * as i1$1 from '@angular/platform-browser';
|
|
10
10
|
import { map, catchError, tap, switchMap } from 'rxjs/operators';
|
|
11
11
|
|
|
@@ -1698,7 +1698,7 @@ class EsolveAuthService {
|
|
|
1698
1698
|
}
|
|
1699
1699
|
autoLogin() {
|
|
1700
1700
|
this.session.restore(this.handleExpiration(), () => {
|
|
1701
|
-
this.getAccessToken('', '', true)
|
|
1701
|
+
firstValueFrom(this.getAccessToken('', '', true)).then(() => { }, (error) => {
|
|
1702
1702
|
console.error(error);
|
|
1703
1703
|
});
|
|
1704
1704
|
});
|
|
@@ -1749,7 +1749,7 @@ class EsolveAuthService {
|
|
|
1749
1749
|
async logout() {
|
|
1750
1750
|
this.session.clearTimer();
|
|
1751
1751
|
this.cookieService.delete('_ws_id');
|
|
1752
|
-
const response = await this.getAccessToken('', '', true)
|
|
1752
|
+
const response = await firstValueFrom(this.getAccessToken('', '', true));
|
|
1753
1753
|
if (response) {
|
|
1754
1754
|
return response;
|
|
1755
1755
|
}
|
|
@@ -1785,7 +1785,7 @@ class EsolveAuthService {
|
|
|
1785
1785
|
// Handlers
|
|
1786
1786
|
handleExpiration() {
|
|
1787
1787
|
return (session) => {
|
|
1788
|
-
this.checkAccessToken(session)
|
|
1788
|
+
firstValueFrom(this.checkAccessToken(session)).then((response) => {
|
|
1789
1789
|
if (response) {
|
|
1790
1790
|
this.handleAuthentication(response);
|
|
1791
1791
|
}
|
|
@@ -3020,6 +3020,23 @@ class EsolveAccountService {
|
|
|
3020
3020
|
return this.processUserAccount(record);
|
|
3021
3021
|
}));
|
|
3022
3022
|
}
|
|
3023
|
+
deleteUserAccount() {
|
|
3024
|
+
return this.http
|
|
3025
|
+
.delete(`${this.config.api_url}/delete-account.php`, {
|
|
3026
|
+
responseType: 'json',
|
|
3027
|
+
observe: 'body',
|
|
3028
|
+
})
|
|
3029
|
+
.pipe(map((http_response) => {
|
|
3030
|
+
if ((http_response.result === undefined) ||
|
|
3031
|
+
(http_response.result === null) ||
|
|
3032
|
+
(http_response.result.status !== 'success')) {
|
|
3033
|
+
throw http_response;
|
|
3034
|
+
}
|
|
3035
|
+
return new EsolveResult(http_response.result.status, http_response.result.code, http_response.result.message);
|
|
3036
|
+
}), catchError((errorRes) => {
|
|
3037
|
+
return this.errorHandler.handleHttpDeleteError('delete-account', errorRes);
|
|
3038
|
+
}));
|
|
3039
|
+
}
|
|
3023
3040
|
setAddress(address_post_data) {
|
|
3024
3041
|
const body = {
|
|
3025
3042
|
address: address_post_data,
|