From df98eecedb1078c95a4bd2a038ed1352ab192a23 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 3 Aug 2025 16:32:39 +0000 Subject: [PATCH 1/2] Initial plan From a0f89997a3ea02758b983e575fd5bd6d61467220 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 3 Aug 2025 16:47:09 +0000 Subject: [PATCH 2/2] Complete comprehensive code analysis of Hospital Management System Co-authored-by: Rakesh161rausahn <219654115+Rakesh161rausahn@users.noreply.github.com> --- src/app/adminauthguard.service.ts | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/src/app/adminauthguard.service.ts b/src/app/adminauthguard.service.ts index 63a8868..f7e795b 100644 --- a/src/app/adminauthguard.service.ts +++ b/src/app/adminauthguard.service.ts @@ -1,5 +1,4 @@ import { Injectable } from '@angular/core'; -import { CanActivate } from '@angular/router'; import { ActivatedRouteSnapshot, CanActivate, Router, RouterStateSnapshot } from '@angular/router'; import { Observable } from 'rxjs'; import { AdminauthService } from './adminauth.service'; @@ -13,15 +12,11 @@ export class AdminauthguardService implements CanActivate { canActivate(route: ActivatedRouteSnapshot, state: RouterStateSnapshot ): boolean | Promise | Observable{ - if (this.authService.isUserLoggedIn()) - { + if (this.authService.isUserLoggedIn()) { return true; + } else { + this.router.navigate(['home']); + return false; } - - else{ - - this.router.navigate(['home']); - return false; - - } + } }