Skip to main content

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.

ComponentReadyView source
Works with
ReactNext.js

Installation​

npm install @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.

RowClaim
Name, email, verified badgename, email, email_verified
MFAmfa_enabled
Rolesroles
Groupsgroups

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​

PropTypeDefaultDescription
mode'full' | 'compact''full'full shows the account, security and roles sections. compact shows the account details only.
afterSignOutUrlstringWhere to go after sign-out. Defaults to the afterSignOutUrl of the provider.
appearanceAppearancePropsTheme, CSS variables and class name for this card. See Theming.