LP#1775466 WS removal loop bug repair
authorBill Erickson <berickxx@gmail.com>
Wed, 25 Jul 2018 20:22:09 +0000 (16:22 -0400)
committerBill Erickson <berickxx@gmail.com>
Wed, 25 Jul 2018 20:22:09 +0000 (16:22 -0400)
Signed-off-by: Bill Erickson <berickxx@gmail.com>
Open-ILS/src/eg2/src/app/staff/login.component.ts

index 3413ea2..0083c32 100644 (file)
@@ -59,10 +59,8 @@ export class StaffLoginComponent implements OnInit {
         // post-login URL
         let url: string = this.auth.redirectUrl || '/staff/splash';
 
-        // prevent sending the user back to the login page or looping
-        // back to the workstation removal page.
-        if (url.startsWith('/staff/login') ||
-            url.startsWith('/staff/admin/workstation/workstations/remove/')) {
+        // prevent sending the user back to the login page
+        if (url.startsWith('/staff/login')) {
             url = '/staff/splash';
         }
 
@@ -75,6 +73,9 @@ export class StaffLoginComponent implements OnInit {
                 if (this.auth.workstationState === AuthWsState.NOT_FOUND_SERVER) {
                     // User attempted to login with a workstation that is
                     // unknown to the server. Redirect to the WS admin page.
+                    // Reset the WS state to avoid looping back to WS removal
+                    // page before the new workstation can be activated.
+                    this.auth.workstationState = AuthWsState.PENDING;
                     this.router.navigate(
                         [`/staff/admin/workstation/workstations/remove/${workstation}`]);
                 } else {