Simplify AuthProvider implementation and remove E2E test store injection via window
- Removed `window.__TEST_AUTH_STORE__` logic for E2E test store injection in `AuthProvider` and related comments. - Updated `AuthInitializer` to clarify E2E test behavior with mocked API responses. - Streamlined `AuthContext` handling by prioritizing explicit `store` prop or production singleton.
This commit is contained in:
@@ -35,12 +35,8 @@ export function AuthInitializer() {
|
||||
const loadAuthFromStorage = useAuth((state) => state.loadAuthFromStorage);
|
||||
|
||||
useEffect(() => {
|
||||
// Skip loading from storage in E2E tests - test store is already injected
|
||||
if (typeof window !== 'undefined' && (window as any).__E2E_TEST__) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Load auth state from encrypted storage on mount
|
||||
// E2E tests use the real flow with mocked API responses
|
||||
loadAuthFromStorage();
|
||||
}, [loadAuthFromStorage]);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user