From a0d212944161346422ded4d678a21fc80694bb0b Mon Sep 17 00:00:00 2001
From: Chris Hines <chris.hines@monash.edu>
Date: Wed, 26 Aug 2020 11:40:28 +1000
Subject: [PATCH] fix some routing bugs

---
 src/app/app-routing.module.ts      | 1 +
 src/app/keygen/keygen.component.ts | 8 +++++++-
 2 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/src/app/app-routing.module.ts b/src/app/app-routing.module.ts
index 2442197..ba2b205 100644
--- a/src/app/app-routing.module.ts
+++ b/src/app/app-routing.module.ts
@@ -34,6 +34,7 @@ const routes: Routes = [
   { path: 'sshauthz_callback', component: KeygenComponent},
   { path: 'transfer', component: TransferComponent },
   { path: 'noaccount/:site', component: NoaccountComponent},
+  { path: '**', component: LauncherComponent},
   //{ path: 'shareconnect', component: ShareconnectComponent }
 
 
diff --git a/src/app/keygen/keygen.component.ts b/src/app/keygen/keygen.component.ts
index e8add09..0d3aa06 100644
--- a/src/app/keygen/keygen.component.ts
+++ b/src/app/keygen/keygen.component.ts
@@ -72,7 +72,13 @@ export class KeygenComponent implements OnInit, OnDestroy {
       switchMap((_) => of([null])),
     );
     agent$.subscribe( (res) => this.router.navigate([sessionStorage.getItem('path')]),
-                      (err) => { console.log(err) ; this.logout(err.sshauthzservice); this.router.navigate(['/noaccount',err.sshauthzservice.name])})
+                      (err) => { console.log(err) ; 
+                                 if (err.sshauthzservice !== undefined ) {
+                                    this.logout(err.sshauthzservice)
+                                    this.router.navigate(['/noaccount',err.sshauthzservice.name])
+                                 } else {
+                                    this.router.navigate(['/login'])}
+                                 } )
   }
 
  extractToken(frag: string) {
-- 
GitLab