From d46191789dd495db658bd3dd1885ff3cffe09fdb Mon Sep 17 00:00:00 2001 From: curo1305 Date: Mon, 13 Apr 2026 18:29:48 +0200 Subject: [PATCH] Redesign login as landing page, remove self-registration, add nav+placeholders MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - LoginPage: centred landing layout with logo placeholder box and business name headline (BUSINESS_NAME constant); registration link removed - useAuth: post-login redirect goes to / (dashboard) directly - Nav: Home | Apps | Settings | Logout (consistent on all protected pages) - AppsPage, SettingsPage: white placeholder pages with headline - App.tsx: /apps and /settings private routes; removed /register, /register-success, /login-success; catch-all → / - Deleted: RegisterPage, RegisterSuccessPage, LoginSuccessPage - Backend /api/auth/register kept for future admin-side user creation Co-Authored-By: Claude Sonnet 4.6 --- frontend/src/App.tsx | 41 +++-------- frontend/src/components/Nav.tsx | 18 +++-- frontend/src/hooks/useAuth.ts | 2 +- frontend/src/pages/AppsPage.tsx | 12 ++++ frontend/src/pages/LoginPage.tsx | 84 ++++++++++++++++------ frontend/src/pages/LoginSuccessPage.tsx | 8 --- frontend/src/pages/RegisterPage.tsx | 64 ----------------- frontend/src/pages/RegisterSuccessPage.tsx | 11 --- frontend/src/pages/SettingsPage.tsx | 12 ++++ 9 files changed, 112 insertions(+), 140 deletions(-) create mode 100644 frontend/src/pages/AppsPage.tsx delete mode 100644 frontend/src/pages/LoginSuccessPage.tsx delete mode 100644 frontend/src/pages/RegisterPage.tsx delete mode 100644 frontend/src/pages/RegisterSuccessPage.tsx create mode 100644 frontend/src/pages/SettingsPage.tsx diff --git a/frontend/src/App.tsx b/frontend/src/App.tsx index f60c84e..9666424 100644 --- a/frontend/src/App.tsx +++ b/frontend/src/App.tsx @@ -1,11 +1,10 @@ import { Routes, Route, Navigate } from "react-router-dom"; +import { useAuth } from "./hooks/useAuth"; import LoginPage from "./pages/LoginPage"; -import RegisterPage from "./pages/RegisterPage"; import DashboardPage from "./pages/DashboardPage"; import ProfilePage from "./pages/ProfilePage"; -import LoginSuccessPage from "./pages/LoginSuccessPage"; -import RegisterSuccessPage from "./pages/RegisterSuccessPage"; -import { useAuth } from "./hooks/useAuth"; +import AppsPage from "./pages/AppsPage"; +import SettingsPage from "./pages/SettingsPage"; function PrivateRoute({ children }: { children: React.ReactNode }) { const { token } = useAuth(); @@ -16,32 +15,14 @@ export default function App() { return ( } /> - } /> - } /> - - - - } - /> - - - - } - /> - - - - } - /> + + } /> + } /> + } /> + } /> + + {/* Catch-all */} + } /> ); } diff --git a/frontend/src/components/Nav.tsx b/frontend/src/components/Nav.tsx index 4b0cb47..1e770fe 100644 --- a/frontend/src/components/Nav.tsx +++ b/frontend/src/components/Nav.tsx @@ -5,10 +5,20 @@ export default function Nav() { const { logout } = useAuth(); return ( - diff --git a/frontend/src/hooks/useAuth.ts b/frontend/src/hooks/useAuth.ts index dafaa24..07d36f2 100644 --- a/frontend/src/hooks/useAuth.ts +++ b/frontend/src/hooks/useAuth.ts @@ -10,7 +10,7 @@ export function useAuth() { const t = await apiLogin(email, password); localStorage.setItem("token", t); setToken(t); - navigate("/login-success"); + navigate("/"); }; const logout = () => { diff --git a/frontend/src/pages/AppsPage.tsx b/frontend/src/pages/AppsPage.tsx new file mode 100644 index 0000000..afd799d --- /dev/null +++ b/frontend/src/pages/AppsPage.tsx @@ -0,0 +1,12 @@ +import Nav from "../components/Nav"; + +export default function AppsPage() { + return ( + <> +