Skip to content

Commit 4276ebc

Browse files
committed
Updated commend and fixed eslint warning
1 parent 70e55b2 commit 4276ebc

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/app/core/data/dso-redirect.service.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ export class DsoRedirectService {
108108
}
109109
}
110110
}
111-
// Redirect to login page if the user is not authenticated to see the requested page
111+
// Handle authentication errors: redirect unauthenticated users to login, authenticated users to forbidden page
112112
if (response.hasFailed && (response.statusCode === 401 || response.statusCode === 403)) {
113113
const isAuthenticated$ = this.authService.isAuthenticated();
114114
isAuthenticated$
@@ -119,10 +119,10 @@ export class DsoRedirectService {
119119
// Extract redirect URL - remove `https://.../namespace` from the current URL. Keep only `handle/...`
120120
const redirectUrl = this.extractHandlePath(window.location.href);
121121
this.authService.setRedirectUrl(redirectUrl);
122-
this.router.navigateByUrl('login');
122+
void this.router.navigateByUrl('login');
123123
} else {
124124
// If the user is authenticated but still has no access, redirect to forbidden page
125-
this.router.navigateByUrl(getForbiddenRoute());
125+
void this.router.navigateByUrl(getForbiddenRoute());
126126
}
127127
});
128128
}

0 commit comments

Comments
 (0)