1
0
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:
2026-03-27 17:30:30 +09:00
parent 75cc6737bd
commit 641e4aba0d
3 changed files with 81 additions and 8 deletions

View File

@@ -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]);