Latest Threat Research:SANDWORM_MODE: Shai-Hulud-Style npm Worm Hijacks CI Workflows and Poisons AI Toolchains.Details
Socket
Book a DemoInstallSign in
Socket

@rolatech/angular-auth

Package Overview
Dependencies
Maintainers
2
Versions
191
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@rolatech/angular-auth - npm Package Compare versions

Comparing version
20.2.8-beta.10
to
20.2.8-beta.11
+24
-10
fesm2022/rolatech-angular-auth.mjs

@@ -336,8 +336,10 @@ import * as i0 from '@angular/core';

const platformId = inject(PLATFORM_ID);
const isContinue = state.url.includes('continue');
const continueUrl = route.queryParams['continue'];
// window = inject(WINDOW)
if (!isPlatformBrowser(platformId)) {
return of(false);
}
const isContinue = state.url.includes('continue');
const continueUrl = route.queryParams['continue'];
const isSignInPage = state.url.includes('/signin');
const currentOrigin = window.location.origin;
const shouldAttachContinue = currentOrigin !== environment.accountsUrl; // or compare to env.publicAppUrl origin if you have it
return authService.introspect().pipe(map$1(({ roles, authenticated }) => {

@@ -351,17 +353,29 @@ const routeRoles = route.data['roles'];

if (authenticated) {
if (window.location.href.includes(environment.accountsUrl) && !isContinue) {
// window.location.href = `${environment.myaccountUrl}/${lang}`;
window.location.href = `${environment.myaccountUrl}`;
if (isSignInPage) {
window.location.href = continueUrl || environment.myaccountUrl;
return false; // Prevent rendering the Sign-in page
}
// 1. If 'continue' parameter exists, redirect to it immediately
if (isContinue) {
window.location.href = continueUrl;
}
// 2. If already at the accounts domain and NO continue URL, redirect to default account page
if (window.location.href.includes(environment.accountsUrl)) {
window.location.href = environment.myaccountUrl;
return false;
}
// 3. Otherwise, if the user is already where they need to be, allow navigation
return true;
}
else {
if (!isContinue) {
window.location.href = environment.accountsUrl + `/signin?continue=${window.location.href}`;
// CASE: Not logged in
if (isSignInPage) {
return true; // Allow guest to see the Sign-in page
}
return true;
// Redirection for UNAUTHENTICATED users
const currentUrl = encodeURIComponent(window.location.href);
console.log(currentUrl);
window.location.href = `${environment.accountsUrl}/signin?continue=${currentUrl}`;
return false;
}
return authenticated;
}));

@@ -368,0 +382,0 @@ };

{
"name": "@rolatech/angular-auth",
"version": "20.2.8-beta.10",
"version": "20.2.8-beta.11",
"private": false,

@@ -10,5 +10,5 @@ "peerDependencies": {

"dependencies": {
"@rolatech/angular-common": "20.2.8-beta.10",
"@rolatech/angular-components": "20.2.8-beta.10",
"@rolatech/angular-services": "20.2.8-beta.10",
"@rolatech/angular-common": "20.2.8-beta.11",
"@rolatech/angular-components": "20.2.8-beta.11",
"@rolatech/angular-services": "20.2.8-beta.11",
"tslib": "^2.3.0"

@@ -15,0 +15,0 @@ },

Sorry, the diff of this file is too big to display