nuxt-x-auth-local
Login
Email/password login form with a forgot-password link for self-hosted JWT backends.
Login
The XAuthLogin component renders an email/password form that posts to your configured login endpoint (localAuth.loginEndpoint). On success it stores the JWT in cookies and navigates to xAuth.redirects.afterLogin (validated by the safe-redirect guard).
Components
<XAuthLogin />
Used by the built-in /auth/login page. The component is self-contained: it takes no props and drives itself from useXAuth() and the xAuth app config.
<XAuthLogin />
Behavior
- Validates with a Zod schema (valid email, non-empty password) before submitting.
- Shows a "Sign up" link when
xAuth.features.signupis notfalse(links toxAuth.redirects.signup). - Shows a "Forgot password?" hint on the password field when
xAuth.features.forgotPasswordistrue(links toxAuth.redirects.forgotPassword). - The form icon comes from
xAuth.ui.form.icon, falling back toi-lucide-log-in. - Submit button shows a loading state while the login request is in flight (
isLoadingfromuseXAuth).
AI Context
component: XAuthLogin
package: "@xenterprises/nuxt-x-auth-local"
use-when: Login page for a self-hosted JWT backend API
nuxt-x-auth-local
Self-hosted JWT authentication Nuxt layer — useXAuth composable, 4 pre-built UI components, global route middleware, automatic token refresh, and full endpoint configurability for your own backend.
Signup
Registration form that posts to the configured signup endpoint of a self-hosted JWT backend.
