feat: add forgot password UI flow
- ForgotPasswordPage: email input, sends reset request, shows success - ResetPasswordPage: reads token from ?token= query param, password + confirm inputs, validates min length, shows success with login link - LoginForm: added [FORGOT PASSWORD?] link below the form - App.tsx: /forgot-password and /reset-password routes (public, no auth) - auth store: requestPasswordReset + resetPassword actions - Backend routes already existed at POST /auth/request-password-reset and POST /auth/reset-password
This commit is contained in:
@@ -9,6 +9,8 @@ import { CommandManager } from './components/CommandManager.tsx';
|
||||
import { RoleManager } from './components/RoleManager.tsx';
|
||||
import { JoinServer } from './components/JoinServer.tsx';
|
||||
import { DMChat } from './components/DMChat.tsx';
|
||||
import { ForgotPasswordPage } from './components/ForgotPasswordPage.tsx';
|
||||
import { ResetPasswordPage } from './components/ResetPasswordPage.tsx';
|
||||
import { useAuthStore } from './stores/auth.ts';
|
||||
|
||||
function ProtectedRoute({ children }: { children: React.ReactNode }) {
|
||||
@@ -32,6 +34,8 @@ function App() {
|
||||
<BrowserRouter>
|
||||
<Routes>
|
||||
<Route path="/login" element={<LoginForm />} />
|
||||
<Route path="/forgot-password" element={<ForgotPasswordPage />} />
|
||||
<Route path="/reset-password" element={<ResetPasswordPage />} />
|
||||
<Route
|
||||
path="/settings"
|
||||
element={
|
||||
|
||||
Reference in New Issue
Block a user