nuxt-x-auth
ResetPassword
New-password form that consumes a reset link's code/token and handles invalid links and the success state.
ResetPassword
The XAuthResetPassword component renders the new-password form reached from a password reset email. It reads the reset credential from the URL — ?code= (Stack Auth) or ?token= (Better Auth / Neon Auth / Local JWT), both are accepted — and calls resetPassword(code, newPassword) on submit.
Three states, transitioned automatically:
- Invalid link — no
code/tokenin the URL. Shows an "Invalid reset link" message with a button back toredirects.forgotPassword. - Form — new password + confirm new password (Zod-validated: minimum 8 characters, passwords must match).
- Success — after a successful reset, shows a confirmation with a "Sign in" button back to
redirects.login.
Components
<XAuthResetPassword />
Place on the /auth/reset-password page (the layer ships this page by default). Works with xAuth.features.forgotPassword.
<XAuthResetPassword />
Props
No props. All configuration comes from the xAuth key in app.config.ts; loading and error states are handled internally via useXAuth.
AI Context
component: XAuthResetPassword
package: "@xenterprises/nuxt-x-auth"
use-when: Reset password page — new-password form consuming a ?code=/?token= reset link
