nuxt-x-auth-local
ForgotPassword
Password reset request form that posts to the configured forgot-password endpoint and shows a success state.
ForgotPassword
The XAuthForgotPassword component renders a single-field form that calls forgotPassword. After submission it always shows a success state (regardless of whether the email exists) to prevent email enumeration. Works when xAuth.features.forgotPassword is true.
Components
<XAuthForgotPassword />
Used by the built-in /auth/forgot-password page, shown when xAuth.features.forgotPassword is true. The component is self-contained: it takes no props and drives itself from useXAuth() and the xAuth app config.
<XAuthForgotPassword />
Behavior
- Validates the email field with a Zod schema before submitting.
- After submission, swaps the form for a "Check your email" success state — shown identically whether or not the account exists (anti-enumeration).
- Provides "Back to sign in" links to
xAuth.redirects.login. - Submit button shows a loading state while the request is in flight (
isLoadingfromuseXAuth).
AI Context
component: XAuthForgotPassword
package: "@xenterprises/nuxt-x-auth-local"
use-when: Forgot password page for a self-hosted JWT backend — prevents email enumeration by always showing success
