Skip to main content
Version: 2.0.0

Manage Profile

The @abpjs/account package provides components for user profile management, including personal settings and password change.

ManageProfile Component

The ManageProfile component provides a complete tabbed interface for profile management:

import { ManageProfile } from '@abpjs/account';

function ProfilePage() {
return (
<ManageProfile
defaultTabIndex={0}
onTabChange={(index) => console.log('Tab changed to', index)}
/>
);
}

Props

PropTypeDefaultDescription
defaultTabIndexnumber0Initial tab to display
onTabChange(index: number) => void-Called when tab changes
customTabsProfileTab[]-Custom tabs to replace defaults

PersonalSettingsForm Component

For standalone use, the PersonalSettingsForm component allows users to update their profile information:

import { PersonalSettingsForm } from '@abpjs/account';

function SettingsPage() {
return (
<PersonalSettingsForm
onSuccess={() => console.log('Profile updated!')}
onError={(error) => console.error(error)}
/>
);
}

Props

PropTypeDescription
onSuccess() => voidCalled after successful update
onError(error: string) => voidCalled on update error

Fields

The form includes the following fields with validation:

  • Username - Required, max 255 characters
  • Email - Required, valid email format
  • Name - Optional, max 64 characters
  • Surname - Optional, max 64 characters
  • Phone Number - Optional, max 16 characters

ChangePasswordForm Component

The ChangePasswordForm component allows users to change their password:

import { ChangePasswordForm } from '@abpjs/account';

function PasswordPage() {
return (
<ChangePasswordForm
onSuccess={() => console.log('Password changed!')}
onError={(error) => console.error(error)}
/>
);
}

Props

PropTypeDescription
onSuccess() => voidCalled after successful password change
onError(error: string) => voidCalled on password change error

Password Requirements

The password must meet the following requirements:

  • Minimum 6 characters
  • Maximum 32 characters
  • At least one lowercase letter
  • At least one uppercase letter
  • At least one number
  • At least one special character

AuthWrapper Component

The AuthWrapper component provides consistent layout for authentication forms:

import { AuthWrapper, LoginForm } from '@abpjs/account';
import { Link } from 'react-router-dom';

function CustomLoginPage() {
return (
<AuthWrapper
mainContent={<LoginForm onSuccess={() => {}} />}
cancelContent={<Link to="/register">Create account</Link>}
/>
);
}

Props

PropTypeDescription
childrenReactNodeMain content (alternative to mainContent)
mainContentReactNodeMain content to render
cancelContentReactNodeFooter/cancel content area
enableLocalLoginbooleanControl local login visibility (v2.0.0)

Local Login Setting (v2.0.0)

The AuthWrapper automatically reads the Abp.Account.EnableLocalLogin setting. When disabled, it shows a message instead of the login form:

// Override the setting value
<AuthWrapper enableLocalLogin={true}>
{/* Always show login form, regardless of setting */}
</AuthWrapper>

// Let the setting control visibility (default)
<AuthWrapper>
{/* Shows form or disabled message based on ABP setting */}
</AuthWrapper>

Custom Tabs

You can provide custom tabs to the ManageProfile component:

import { ManageProfile } from '@abpjs/account';

function CustomProfilePage() {
const customTabs = [
{
id: 'personal',
label: 'Personal Info',
content: <MyCustomPersonalForm />,
},
{
id: 'security',
label: 'Security',
content: <MyCustomSecurityForm />,
},
{
id: 'notifications',
label: 'Notifications',
content: <MyNotificationSettings />,
},
];

return <ManageProfile customTabs={customTabs} />;
}