ngx-sp-auth 4.23.6 → 4.23.7
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
|
@@ -4704,7 +4704,7 @@ class LoginGuard {
|
|
|
4704
4704
|
* @param route Rota atual
|
|
4705
4705
|
* @param segments Segmentos.
|
|
4706
4706
|
* @returns
|
|
4707
|
-
|
|
4707
|
+
*/
|
|
4708
4708
|
canLoad(_route, _segments) {
|
|
4709
4709
|
return this.authStorageService.checkAuthentication()
|
|
4710
4710
|
.pipe(map(() => {
|
|
@@ -4714,6 +4714,15 @@ class LoginGuard {
|
|
|
4714
4714
|
return true;
|
|
4715
4715
|
}));
|
|
4716
4716
|
}
|
|
4717
|
+
canMatch(_route, segments) {
|
|
4718
|
+
return this.authStorageService.checkAuthentication()
|
|
4719
|
+
.pipe(map(() => {
|
|
4720
|
+
if ((_route.path === "auth/login" && this.authStorageService.isLoggedInSub.value && !this.authStorageService.isExternalLogin)) {
|
|
4721
|
+
return this.router.createUrlTree(["/home"]);
|
|
4722
|
+
}
|
|
4723
|
+
return true;
|
|
4724
|
+
}));
|
|
4725
|
+
}
|
|
4717
4726
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: LoginGuard, deps: [{ token: i1$1.Router }, { token: AuthStorageService }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
4718
4727
|
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: LoginGuard, providedIn: 'root' }); }
|
|
4719
4728
|
}
|