feat: add manual bank card screens
Add cards, operations, refunds, categories and monthly summaries with Mantine date controls. Derive banking types from runtime OpenAPI. Cover recovery and session isolation.
This commit is contained in:
@@ -22,8 +22,16 @@ const Protected: FC<PropsWithChildren> = (props) => {
|
||||
const Public: FC<PropsWithChildren> = (props) => {
|
||||
const { children } = props;
|
||||
const { user, ready } = useAuth();
|
||||
const location = useLocation();
|
||||
const requested = (location.state as { returnTo?: string } | null)?.returnTo;
|
||||
const returnTo =
|
||||
typeof requested === "string" &&
|
||||
requested.startsWith("/") &&
|
||||
!requested.startsWith("//")
|
||||
? requested
|
||||
: "/accounts";
|
||||
if (!ready) return <RouteSkeleton variant="shell" />;
|
||||
return user ? <Navigate to="/accounts" replace /> : children;
|
||||
return user ? <Navigate to={returnTo} replace /> : children;
|
||||
};
|
||||
|
||||
export { Protected, Public };
|
||||
|
||||
Reference in New Issue
Block a user