diff --git a/src/app/shared/guards/authentication.guard.ts b/src/app/shared/guards/authentication.guard.ts index d7296c9..7bc39f7 100644 --- a/src/app/shared/guards/authentication.guard.ts +++ b/src/app/shared/guards/authentication.guard.ts @@ -6,6 +6,7 @@ import { CredentialService } from '../../services/credential.service'; import { FormConstants } from '../../utils/enums'; import { ButtonManagementService } from '../../services/button-management.service'; import { StorageService } from '../services/storage.service'; +import { LOGIN_ROUTE } from '../../utils/app.constants'; @Injectable( @@ -49,7 +50,9 @@ export class AuthenticationGuard implements CanActivate { return true; } else { - this.authService.logout(); + if(this.router.url != LOGIN_ROUTE){ + this.authService.logout(); + } return false; } diff --git a/src/app/utils/app.constants.ts b/src/app/utils/app.constants.ts index f7e1ab5..28ad869 100644 --- a/src/app/utils/app.constants.ts +++ b/src/app/utils/app.constants.ts @@ -49,3 +49,5 @@ export const EXCEL_FILE_EXTENSION = '.xlsx'; export const LOGGING_DETAILS_FILE_NAME = 'Activity-Logs-Details'; export const TRANSACTION_LOGS_FILE_NAME = 'Transaction-Logs-Details'; + +export const LOGIN_ROUTE = '/login';