Only use CAPTCHA in logged out operations and pages (#10607)
Issue #10235 --------- Co-authored-by: ad-elias <elias@autodiligence.com>
This commit is contained in:
@ -0,0 +1,13 @@
|
||||
import { matchPath } from 'react-router-dom';
|
||||
import { CAPTCHA_PROTECTED_PATHS } from '../constants/CaptchaProtectedPaths';
|
||||
|
||||
export const isCaptchaRequiredForPath = (pathname: string): boolean =>
|
||||
CAPTCHA_PROTECTED_PATHS.some((path) =>
|
||||
matchPath(
|
||||
{
|
||||
path,
|
||||
end: false, // Match nested routes too
|
||||
},
|
||||
pathname,
|
||||
),
|
||||
);
|
||||
Reference in New Issue
Block a user