Overview
The @abpjs/account package provides pre-built authentication components including login forms, registration, and multi-tenant switching.
Installation
npm install @abpjs/account
Required peer dependencies:
npm install @abpjs/core @abpjs/theme-shared
Features
- Login Form - Complete login interface with validation
- Registration Form - User registration with validation
- Tenant Box - Multi-tenant switching component
- OAuth2 Support - Password flow authentication
- Form Validation - Built-in validation using Zod
Main Exports
Components
| Component | Description |
|---|---|
LoginForm | Login form with username/password fields |
RegisterForm | User registration form |
TenantBox | Tenant selection component |
LoginPage | Pre-built login page |
RegisterPage | Pre-built registration page |
Hooks
| Hook | Description |
|---|---|
usePasswordFlow | OAuth2 resource owner password flow |
Quick Example
import { LoginForm } from '@abpjs/account';
function LoginPage() {
return (
<LoginForm
onSuccess={() => console.log('Logged in!')}
onError={(error) => console.error(error)}
showRegisterLink
showForgotPassword
/>
);
}
NPM Package
View on npm: @abpjs/account
Documentation
- Login - Login form and password flow
- Register - Registration form
- Tenant Box - Multi-tenant switching