mirror of
https://github.com/Tria-plc/emaui.git
synced 2026-08-30 00:38:12 +00:00
17 lines
530 B
TypeScript
17 lines
530 B
TypeScript
import { Navigate } from 'react-router-dom';
|
|
import { LandingPage } from '@ema-platform/ui';
|
|
import { useAuthToken } from '@ema-platform/auth';
|
|
|
|
/**
|
|
* Public `/`. Signed-in visitors skip the landing page entirely and go
|
|
* straight to the dashboard. Backoffice has no /signup (enableSignup: false)
|
|
* and no /verify route, so those props are omitted.
|
|
*/
|
|
export function LandingRoute() {
|
|
const token = useAuthToken();
|
|
|
|
if (token) return <Navigate to="/dashboard" replace />;
|
|
|
|
return <LandingPage primaryHref="/login" />;
|
|
}
|