commit 82d3b19912a411d39c1a87c292564bc8d760eabb Author: Schiefelbein, Andrew Date: Mon Oct 5 13:01:25 2020 -0500 Fix routing to / on a refresh with an auth verify This will now not force you to renavigate when already authenticated and refreshing the browser Change-Id: Ied840489f67b79198e99289db69c66ecea701837 diff --git a/client/src/services/auth-guard/auth-guard.service.ts b/client/src/services/auth-guard/auth-guard.service.ts index b91711e..e04ba9f 100755 --- a/client/src/services/auth-guard/auth-guard.service.ts +++ b/client/src/services/auth-guard/auth-guard.service.ts @@ -80,7 +80,11 @@ export class AuthGuard implements WSReceiver, CanActivate { case 'approved': Log.Debug(new LogMessage('Auth approved received', this.className, message)); this.setToken(message.token); - this.router.navigate(['/']); + // redirect to / only when on /login otherwise leave the path where it was before the auth attempt + const location = window.location.pathname; + if (location === '/login' || location === '/login/') { + this.router.navigate(['/']); + } break; case 'denied': Log.Debug(new LogMessage('Auth denied received', this.className, message));