/** * WP Forgot Password Page * * Simple email-based password reset request for WordPress plugin users. * * (c) 2026 TWWIM UG. All rights reserved. (www.twwim.com) */ import { useState } from 'react'; import { Button } from '@/components/ui/button'; import { Input } from '@/components/ui/input'; import { Label } from '@/components/ui/label'; import { Alert, AlertDescription } from '@/components/ui/alert'; import { AuthLayout } from '@/features/auth/components/AuthLayout'; import { AlertCircle, CheckCircle } from 'lucide-react'; import { apiClient } from '@/infrastructure/http/ApiClient'; import { FORGOT_PASSWORD } from '@archer/api-interface/endpoints/customer-api'; export function WpForgotPasswordPage({ onBack }: { onBack: () => void }) { const [email, setEmail] = useState(''); const [isSubmitting, setIsSubmitting] = useState(false); const [success, setSuccess] = useState(false); const [error, setError] = useState(null); const handleSubmit = async (e: React.FormEvent) => { e.preventDefault(); if (!email) return; setIsSubmitting(true); setError(null); try { await apiClient.post(FORGOT_PASSWORD.path, { email }); setSuccess(true); } catch (err: any) { // Always show success to prevent email enumeration setSuccess(true); } finally { setIsSubmitting(false); } }; if (success) { return (

Check Your Email

If an account exists for {email}, you will receive a password reset link.

); } return (

Reset Password

Enter your email and we'll send you a reset link.

setEmail(e.target.value)} placeholder="you@example.com" required />
{error && ( {error} )}
); }