LP2006513 Angular login redirect repair
authorBill Erickson <berickxx@gmail.com>
Wed, 22 Feb 2023 18:55:06 +0000 (13:55 -0500)
committerJane Sandberg <js7389@princeton.edu>
Wed, 22 Feb 2023 20:57:30 +0000 (12:57 -0800)
The routeTo parameter must contain an eg2-based path (/staff/splash)
and not a full path (/eg2/staff/splash) or URL.

Signed-off-by: Bill Erickson <berickxx@gmail.com>
Signed-off-by: Jane Sandberg <js7389@princeton.edu>

Open-ILS/src/eg2/src/app/staff/resolver.service.ts

index 225b931..69825a6 100644 (file)
@@ -121,8 +121,8 @@ export class StaffResolver implements Resolve<Observable<any>> {
     // valid auth token.  Send the caller back to the login page.
     handleInvalidToken(state: RouterStateSnapshot): void {
         console.debug('StaffResolver: authtoken is not valid');
-        const url = this.ngLocation.prepareExternalUrl(state.url);
-        this.router.navigate([LOGIN_PATH], {queryParams: {routeTo: url}});
+        // state.url is the eg2 path, not a full URL.
+        this.router.navigate([LOGIN_PATH], {queryParams: {routeTo: state.url}});
         this.observer.error('invalid or no auth token');
     }