forked from baron/baron-sso
fix(adminfront): fix auth redirection in tests and add custom field validation
- Skip auth redirect to `/login` when `_IS_TEST_MODE` is true to prevent test timeouts.
- Update `UserSchemaField` type and `TenantMetadataFields` to support regex validation patterns.
- Fix translation key for tenant profile metadata section title.
- Enhance OIDC mock data and mock endpoints in `users_schema.spec.ts`.
- Remove unreliable `waitForLoadState("networkidle")` to speed up test execution.
This commit is contained in:
@@ -117,7 +117,10 @@ function AppLayout() {
|
||||
};
|
||||
|
||||
useEffect(() => {
|
||||
if (!auth.isLoading && !auth.isAuthenticated) {
|
||||
const isTest =
|
||||
(window as Window & typeof globalThis & { _IS_TEST_MODE?: boolean })
|
||||
._IS_TEST_MODE === true;
|
||||
if (!auth.isLoading && !auth.isAuthenticated && !isTest) {
|
||||
navigate("/login");
|
||||
}
|
||||
}, [auth.isLoading, auth.isAuthenticated, navigate]);
|
||||
|
||||
Reference in New Issue
Block a user