ngx-sp-auth 4.23.13 → 4.23.14
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/fesm2022/ngx-sp-auth.mjs
CHANGED
|
@@ -2335,7 +2335,12 @@ class LoginOSComponent {
|
|
|
2335
2335
|
this.timer = 3;
|
|
2336
2336
|
}
|
|
2337
2337
|
ngOnInit() {
|
|
2338
|
-
this._storageService.
|
|
2338
|
+
this._storageService.isLoggedInSub.subscribe(async (isLoggedIn) => {
|
|
2339
|
+
if (isLoggedIn) {
|
|
2340
|
+
// Comentado até encontrar uma maneira melhor de realizar o logout, pois o logout atual está causando problemas de redirecionamento e perda de sessão.
|
|
2341
|
+
// await this._storageService.logout();
|
|
2342
|
+
}
|
|
2343
|
+
});
|
|
2339
2344
|
this.getParams();
|
|
2340
2345
|
this.logOn();
|
|
2341
2346
|
}
|
|
@@ -4538,8 +4543,9 @@ class AuthGuard {
|
|
|
4538
4543
|
IsUserAuth(targetUrl = this._router.url) {
|
|
4539
4544
|
return this._authStorage.checkAuthentication()
|
|
4540
4545
|
.pipe(map$1(({ error, isLoggedIn }) => {
|
|
4541
|
-
|
|
4542
|
-
|
|
4546
|
+
const targetPath = targetUrl.split(/[?#]/, 1)[0].replace(/\/+$/, '').toLowerCase();
|
|
4547
|
+
const isPublicRoute = ['/auth/login', '/senha-config', '/login-os', '/error-404'].includes(targetPath);
|
|
4548
|
+
if ((!isLoggedIn || this._authStorage.isExternalLogin) && !isPublicRoute) {
|
|
4543
4549
|
if (error.trim() && (targetPath !== '/auth/login' && targetPath !== '')) {
|
|
4544
4550
|
this._router.events.pipe(filter$1((event) => event instanceof NavigationEnd), filter$1(event => event.urlAfterRedirects.split(/[?#]/, 1)[0] === '/auth/login'), take$1(1))
|
|
4545
4551
|
.subscribe(() => this._message.showAlertWarning(error));
|