LP2006513 Angular login redirect repair
authorBill Erickson <berickxx@gmail.com>
Wed, 22 Feb 2023 18:55:06 +0000 (13:55 -0500)
committerChris Sharp <csharp@georgialibraries.org>
Wed, 22 Feb 2023 22:30:08 +0000 (17:30 -0500)
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>
Open-ILS/src/eg2/src/app/staff/resolver.service.ts

index b8d224c..3138790 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');
     }