Files
cbsnexora/src/app/remittances/remittance-enabled.guard.ts
T
Shubham KumarandGitHub 4c8f5d8343 WEB-506 feat: add Remittance Module with 7-step payout wizard (#3200)
WEB-506 fix: address CodeRabbit review (security, validation)

WEB-506 fix: make API gateway header name configurable (MIFOS_REMITTANCE_API_HEADER)

WEB-506 fix: remove duplicate translation keys (Personal Information, Transaction Details)
2026-02-21 23:52:37 -06:00

27 lines
785 B
TypeScript

/**
* Copyright since 2025 Mifos Initiative
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
import { inject } from '@angular/core';
import { Router, CanActivateFn } from '@angular/router';
import { remittanceConfig } from './remittance.config';
/**
* Guard to prevent access to the Remittance module if it is disabled in the config.
*/
export const remittanceEnabledGuard: CanActivateFn = () => {
const router = inject(Router);
if (remittanceConfig.isRemittanceEnabled) {
return true;
}
// If disabled, redirect to home or a 404 page
router.navigate(['/home'], { replaceUrl: true });
return false;
};