@posiwise/common-services 0.2.12 → 0.2.13
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.
|
@@ -8,7 +8,7 @@ import { DOCUMENT, CommonModule } from '@angular/common';
|
|
|
8
8
|
import * as i1$2 from '@angular/common/http';
|
|
9
9
|
import { HttpErrorResponse, HttpHeaders } from '@angular/common/http';
|
|
10
10
|
import { throwError, of, BehaviorSubject, tap, timer } from 'rxjs';
|
|
11
|
-
import { catchError, take, switchMap, map, mergeMap,
|
|
11
|
+
import { catchError, take, tap as tap$1, switchMap, map, mergeMap, distinctUntilChanged } from 'rxjs/operators';
|
|
12
12
|
import { HelperService } from '@posiwise/helper-service';
|
|
13
13
|
import * as i1$1 from 'ngx-toastr';
|
|
14
14
|
import { getUser, SetUser, UserActionTypes, appReducers } from '@posiwise/app-store';
|
|
@@ -1108,9 +1108,12 @@ class AuthService {
|
|
|
1108
1108
|
phonegap: true
|
|
1109
1109
|
};
|
|
1110
1110
|
}
|
|
1111
|
-
//
|
|
1112
|
-
|
|
1113
|
-
return this.http.delete('session', options)
|
|
1111
|
+
// Send DELETE request with token intact, then clear tokens after response
|
|
1112
|
+
// Use tap to clear tokens without changing the response stream
|
|
1113
|
+
return this.http.delete('session', options).pipe(tap$1(() => {
|
|
1114
|
+
// Clear tokens AFTER logout succeeds
|
|
1115
|
+
this.secureTokenStorage.clearTokens().subscribe();
|
|
1116
|
+
}));
|
|
1114
1117
|
}
|
|
1115
1118
|
/**
|
|
1116
1119
|
* Clear all authentication tokens
|
|
@@ -2991,7 +2994,9 @@ class SentryErrorHandler {
|
|
|
2991
2994
|
const isEdge = /Edg\//.test(navigator.userAgent);
|
|
2992
2995
|
if (isEdge && hint?.originalException) {
|
|
2993
2996
|
const originalException = hint.originalException;
|
|
2994
|
-
if (originalException &&
|
|
2997
|
+
if (originalException &&
|
|
2998
|
+
typeof originalException === 'object' &&
|
|
2999
|
+
originalException['isTrusted'] === true) {
|
|
2995
3000
|
// Block Edge synthetic browser events from being sent to Sentry
|
|
2996
3001
|
return null;
|
|
2997
3002
|
}
|