5509 remove flash on intermediate verify step when sign in with sso (#5526)
- remove flash on /verify - remove flash on signInUp - remove useless redirections and hooks - Remove DefaultHomePage component - Move redirections to /objects/companies in PageChangeEffect - add useShowAuthModal hooks and tests - add usePageChangeEffectNaviteLocation hooks and tests - fix refresh token expired produces blank screen
This commit is contained in:
@ -15,7 +15,7 @@ import {
|
||||
IconUsers,
|
||||
} from 'twenty-ui';
|
||||
|
||||
import { useSignOutAndRedirect } from '@/auth/hooks/useSignOutAndRedirect';
|
||||
import { useAuth } from '@/auth/hooks/useAuth';
|
||||
import { billingState } from '@/client-config/states/billingState';
|
||||
import { SettingsNavigationDrawerItem } from '@/settings/components/SettingsNavigationDrawerItem';
|
||||
import { SettingsPath } from '@/types/SettingsPath';
|
||||
@ -25,7 +25,7 @@ import { NavigationDrawerSection } from '@/ui/navigation/navigation-drawer/compo
|
||||
import { NavigationDrawerSectionTitle } from '@/ui/navigation/navigation-drawer/components/NavigationDrawerSectionTitle';
|
||||
|
||||
export const SettingsNavigationDrawerItems = () => {
|
||||
const handleLogout = useSignOutAndRedirect();
|
||||
const { signOut } = useAuth();
|
||||
|
||||
const billing = useRecoilValue(billingState);
|
||||
|
||||
@ -113,7 +113,7 @@ export const SettingsNavigationDrawerItems = () => {
|
||||
/>
|
||||
<NavigationDrawerItem
|
||||
label="Logout"
|
||||
onClick={handleLogout}
|
||||
onClick={signOut}
|
||||
Icon={IconDoorEnter}
|
||||
/>
|
||||
</NavigationDrawerSection>
|
||||
|
||||
@ -2,7 +2,7 @@ import { useState } from 'react';
|
||||
import { useRecoilValue } from 'recoil';
|
||||
import { H2Title } from 'twenty-ui';
|
||||
|
||||
import { useSignOutAndRedirect } from '@/auth/hooks/useSignOutAndRedirect';
|
||||
import { useAuth } from '@/auth/hooks/useAuth';
|
||||
import { currentUserState } from '@/auth/states/currentUserState';
|
||||
import { Button } from '@/ui/input/button/components/Button';
|
||||
import { ConfirmationModal } from '@/ui/layout/modal/components/ConfirmationModal';
|
||||
@ -15,11 +15,11 @@ export const DeleteAccount = () => {
|
||||
const [deleteUserAccount] = useDeleteUserAccountMutation();
|
||||
const currentUser = useRecoilValue(currentUserState);
|
||||
const userEmail = currentUser?.email;
|
||||
const handleLogout = useSignOutAndRedirect();
|
||||
const { signOut } = useAuth();
|
||||
|
||||
const deleteAccount = async () => {
|
||||
await deleteUserAccount();
|
||||
handleLogout();
|
||||
await signOut();
|
||||
};
|
||||
|
||||
return (
|
||||
|
||||
@ -2,7 +2,7 @@ import { useState } from 'react';
|
||||
import { useRecoilValue } from 'recoil';
|
||||
import { H2Title } from 'twenty-ui';
|
||||
|
||||
import { useSignOutAndRedirect } from '@/auth/hooks/useSignOutAndRedirect';
|
||||
import { useAuth } from '@/auth/hooks/useAuth';
|
||||
import { currentUserState } from '@/auth/states/currentUserState';
|
||||
import {
|
||||
ConfirmationModal,
|
||||
@ -18,11 +18,11 @@ export const DeleteWorkspace = () => {
|
||||
const currentUser = useRecoilValue(currentUserState);
|
||||
const userEmail = currentUser?.email;
|
||||
|
||||
const handleLogout = useSignOutAndRedirect();
|
||||
const { signOut } = useAuth();
|
||||
|
||||
const deleteWorkspace = async () => {
|
||||
await deleteCurrentWorkspace();
|
||||
handleLogout();
|
||||
await signOut();
|
||||
};
|
||||
|
||||
return (
|
||||
|
||||
Reference in New Issue
Block a user