User profile
A card with the account of the signed-in person. It shows the name, the email, its verification state and the roles, and a sign-out button.
Installation
- npm
- pnpm
- Yarn
- Bun
npm install @lumoauth/react
pnpm add @lumoauth/react
yarn add @lumoauth/react
bun add @lumoauth/react
Usage
src/pages/Account.tsx
import { UserProfile } from '@lumoauth/react';
export default function AccountPage() {
return <UserProfile afterSignOutUrl="/" />;
}
The card is read-only. To let a person change the profile, link to the hosted account pages: the user button does that with its "Manage account" item.
What it shows
The card reads the UserInfo response. A row appears only when the response holds its claim.
| Row | Claim |
|---|---|
| Name, email, verified badge | name, email, email_verified |
| MFA | mfa_enabled |
| Roles | roles |
| Groups | groups |
LumoAuth sends roles only when the application's token settings have User roles turned on and saved. The values are role identifiers, such as ROLE_TENANT_ROLE_EDITOR for the role editor. Its UserInfo response does not hold mfa_enabled or groups, so with LumoAuth those two rows stay hidden.
Examples
Compact
mode="compact" shows the account details only.
Props
| Prop | Type | Default | Description |
|---|---|---|---|
mode | 'full' | 'compact' | 'full' | full shows the account, security and roles sections. compact shows the account details only. |
afterSignOutUrl | string | Where to go after sign-out. Defaults to the afterSignOutUrl of the provider. | |
appearance | AppearanceProps | Theme, CSS variables and class name for this card. See Theming. |