@open-rlb/ng-app 3.0.10 → 3.0.12
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.
|
@@ -1327,7 +1327,7 @@ class AuthenticationService {
|
|
|
1327
1327
|
this.logger.info(`Correct provider dispatched, redirectUrl: ${redirect}`);
|
|
1328
1328
|
if (redirect) {
|
|
1329
1329
|
this.cookiesService.deleteCookie('loginRedirectUrl');
|
|
1330
|
-
this.router.
|
|
1330
|
+
this.router.navigateByUrl(redirect, { replaceUrl: true });
|
|
1331
1331
|
}
|
|
1332
1332
|
else {
|
|
1333
1333
|
this.router.navigate([], {
|
|
@@ -1350,9 +1350,10 @@ class AuthenticationService {
|
|
|
1350
1350
|
}));
|
|
1351
1351
|
//}
|
|
1352
1352
|
}
|
|
1353
|
-
login() {
|
|
1354
|
-
|
|
1355
|
-
this.
|
|
1353
|
+
login(targetUrl) {
|
|
1354
|
+
const returnUrl = targetUrl || this.router.url || '/';
|
|
1355
|
+
this.cookiesService.setCookie('loginRedirectUrl', returnUrl, 1);
|
|
1356
|
+
this.logger.log(`call login method, loginRedirectUrl: ${returnUrl}`);
|
|
1356
1357
|
// electron
|
|
1357
1358
|
if (typeof (process) !== 'undefined' &&
|
|
1358
1359
|
typeof (process?.version) !== 'undefined' &&
|
|
@@ -2350,7 +2351,7 @@ const oauthGuard = (route, state) => {
|
|
|
2350
2351
|
const authService = inject(AuthenticationService);
|
|
2351
2352
|
return authService.isAuthenticated$.pipe(take(1), map((isAuthenticated) => {
|
|
2352
2353
|
if (!isAuthenticated) {
|
|
2353
|
-
authService.login();
|
|
2354
|
+
authService.login(state.url);
|
|
2354
2355
|
return false;
|
|
2355
2356
|
}
|
|
2356
2357
|
return true;
|
|
@@ -2994,7 +2995,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImpo
|
|
|
2994
2995
|
}] });
|
|
2995
2996
|
|
|
2996
2997
|
function authInitializer(authService) {
|
|
2997
|
-
console.warn("authInitializer!!");
|
|
2998
2998
|
return () => authService.checkAuthMultiple();
|
|
2999
2999
|
}
|
|
3000
3000
|
|