{
const [submitting, setSubmitting] = useState(false);
const navigate = useNavigate();
const auth = useAuth();
+ const handleBack = () => undefined;
const handleLogin = (_values: LoginFormData) => {
setSubmitting(true);
@@ -23,14 +24,6 @@ export const AdminLogin: React.FC = () => {
}
};
- const handleBack = () => {
- navigate('/');
- };
-
- const handleOnLogin = () => {
- globalThis.location.href = '/auth-redirect';
- };
-
return (
{
onSubmit={handleLogin}
submitting={submitting}
onBack={handleBack}
+ showBack={false}
headerSlot={
navigate('/')}
/>
}
diff --git a/packages/sthrift/ui-admin-route-root/src/app-routes.tsx b/packages/sthrift/ui-admin-route-root/src/app-routes.tsx
index 63edc0310..38edeb99d 100644
--- a/packages/sthrift/ui-admin-route-root/src/app-routes.tsx
+++ b/packages/sthrift/ui-admin-route-root/src/app-routes.tsx
@@ -1,5 +1,4 @@
import { Route, Routes } from 'react-router-dom';
-import { RequireAuth } from '@sthrift/ui-admin-route-shared';
import { SectionLayout } from './section-layout.tsx';
import { Listings } from './components/pages/home/pages/all-listings-page.tsx';
import { ViewListing } from './components/pages/view-listing/pages/view-listing-page.tsx';
@@ -11,14 +10,7 @@ export const AppRoutes: React.FC = () => {
}>
} />
} />
-
-
-
- }
- />
+ } />
);
diff --git a/packages/sthrift/ui-admin-route-root/src/section-layout.tsx b/packages/sthrift/ui-admin-route-root/src/section-layout.tsx
index 7e7065aab..c44c954d8 100644
--- a/packages/sthrift/ui-admin-route-root/src/section-layout.tsx
+++ b/packages/sthrift/ui-admin-route-root/src/section-layout.tsx
@@ -56,10 +56,6 @@ export const SectionLayout: React.FC = () => {
return () => window.removeEventListener('resize', handleResize);
}, [auth.isAuthenticated]);
- const handleOnLogin = () => {
- navigate('/login');
- };
-
const handleLogOut = () => {
HandleLogout(auth, apolloClient, window.location.origin);
};
@@ -93,7 +89,6 @@ export const SectionLayout: React.FC = () => {
>
void;
onLogout?: () => void;
}
@@ -14,7 +13,6 @@ const { Header: AntHeader } = Layout;
export const AdminHeader: React.FC
= ({
isAuthenticated,
- onLogin,
onLogout,
}) => {
return (
@@ -35,15 +33,7 @@ export const AdminHeader: React.FC = ({
>
Log Out
- ) : (
-
- )}
+ ) : null}
);
diff --git a/packages/sthrift/ui-admin-route-user-operations/src/section-layout.tsx b/packages/sthrift/ui-admin-route-user-operations/src/section-layout.tsx
index e0d444450..fa0691a89 100644
--- a/packages/sthrift/ui-admin-route-user-operations/src/section-layout.tsx
+++ b/packages/sthrift/ui-admin-route-user-operations/src/section-layout.tsx
@@ -56,10 +56,6 @@ export const SectionLayout: React.FC = () => {
return () => window.removeEventListener('resize', handleResize);
}, [auth.isAuthenticated]);
- const handleOnLogin = () => {
- navigate('/login');
- };
-
const handleLogOut = () => {
HandleLogout(auth, apolloClient, window.location.origin);
};
@@ -93,7 +89,6 @@ export const SectionLayout: React.FC = () => {
>
void;
headerSlot: React.ReactNode;
footerSlot?: React.ReactNode;
+ showBack?: boolean;
showForgotPassword?: boolean;
onForgotPassword?: () => void;
}
@@ -30,6 +31,7 @@ export const LoginForm: React.FC
= ({
onBack,
headerSlot,
footerSlot,
+ showBack = true,
showForgotPassword,
onForgotPassword,
}) => {
@@ -166,17 +168,24 @@ export const LoginForm: React.FC = ({
-
+ {showBack && (
+
+ )}
{showForgotPassword && onForgotPassword && (