feat: rewrite auth (#364)
* feat: wip rewrite auth * feat: restructure folders and fix stories and tests * feat: remove auth provider and fix tests
This commit is contained in:
@ -10,7 +10,6 @@ import { HorizontalSeparator } from '@/auth/components/ui/HorizontalSeparator';
|
||||
import { Logo } from '@/auth/components/ui/Logo';
|
||||
import { Modal } from '@/auth/components/ui/Modal';
|
||||
import { Title } from '@/auth/components/ui/Title';
|
||||
import { hasAccessToken } from '@/auth/services/AuthService';
|
||||
import { authFlowUserEmailState } from '@/auth/states/authFlowUserEmailState';
|
||||
import { isMockModeState } from '@/auth/states/isMockModeState';
|
||||
import { PrimaryButton } from '@/ui/components/buttons/PrimaryButton';
|
||||
@ -34,14 +33,6 @@ export function Index() {
|
||||
authFlowUserEmailState,
|
||||
);
|
||||
|
||||
useEffect(() => {
|
||||
setMockMode(true);
|
||||
|
||||
if (hasAccessToken()) {
|
||||
navigate('/');
|
||||
}
|
||||
}, [navigate, setMockMode]);
|
||||
|
||||
const onGoogleLoginClick = useCallback(() => {
|
||||
window.location.href = process.env.REACT_APP_AUTH_URL + '/google' || '';
|
||||
}, []);
|
||||
@ -62,6 +53,10 @@ export function Index() {
|
||||
[onPasswordLoginClick],
|
||||
);
|
||||
|
||||
useEffect(() => {
|
||||
setMockMode(true);
|
||||
}, [navigate, setMockMode]);
|
||||
|
||||
return (
|
||||
<>
|
||||
<Companies />
|
||||
|
||||
Reference in New Issue
Block a user