Customizing Self-Service Account Management

On this page
Starter plan required

This feature requires at least a Starter plan.

Available since 1.26.0

FusionAuth ships with a default form and a default theme template for each self-service account management page. You can add fields to the form, so users can update more of their profile. You can also edit the templates, so the account pages match the rest of your application.

This guide adds a birthDate field to the account edit form, then shows the field on the account home page.

Add a Field to the Self-Service Form#

Forms can collect any user data. The following steps add the built-in Birthdate field to the default self-service form:

  1. Navigate to Forms .

  2. Click on Default User Self Service provided by FusionAuth.

    The Forms list with the Default User Self Service form highlighted.

    The form editor lists the fields on the form. Use the up and down arrows to reorder the fields.

    The Default User Self Service form editor.
  3. Click Add field .

  4. Select Birthdate and click Submit .

    The Add Field dialog with Birthdate selected.

This example uses a built-in field. You can also add custom fields, such as user.data.favColor. Forms can also split fields into sections, mark fields as required or optional, and limit some fields to admins. For more information, see Advanced Registration Forms.

Check the Form Field#

The self-service account pages are separate from the Admin UI. The Manage page for a user in the Admin UI shows the admin view of the user, not the account pages. To see the account pages as a user:

  1. When the Application has no self-service form, navigate to Applications -> Edit Application -> Registration . Set User Self-service to the form you edited, and click .

  2. Navigate to Applications and click on the Application.

  3. Copy the Account URL. The URL has the following format:

    https://<your-fusionauth-host>/account/?client_id=<client-id>
    
  4. Open the URL in a private window or a different browser. The account pages use a separate session, and a private window keeps your admin session out of the way.

  5. Log in as a user who is registered for the Application. The Admin UI has no option to log in as another user, so use the credentials of a test user.

  6. Click Edit profile .

The account edit form now shows the Birthdate field:

The account edit form with the Birthdate field added.

In your application, link to the Account URL from your navigation, so users can reach the account pages. For more information, see Open the Self-Service Pages.

Edit the Account Templates#

The account home page doesn't show the Birthdate field yet. To show the field, edit the account templates in an advanced theme:

  1. Navigate to Customizations -> Themes .
  2. Open the action menu on the default theme and click Duplicate . You can also create a new theme.
  3. Click on the new theme.

The following templates control the account pages:

  • Account edit
  • Account index
  • Account two-factor disable
  • Account two-factor edit
  • Account two-factor enable
  • Account two-factor index
  • Account add WebAuthn passkeyA credential that replaces a password with a key pair stored on the user's device. Passkeys use the WebAuthn standard. (available in 1.41.0 and later)
  • Account delete WebAuthn passkey (available in 1.41.0 and later)
  • Account WebAuthn index (available in 1.41.0 and later)
The theme editor with the account management templates highlighted.

For more information, see Themes.

Show the Field on the Account Home Page#

The Account index template renders the account home page. Click Account index . Find the Phone number field, and add the following after the Phone number field:

<div>
  <div class="text-xs font-medium text-text mb-1">${theme.message("user.birthDate")}</div>
  <div class="text-sm text-text">${helpers.display(user, "birthDate")}</div>
</div>

The helpers.display function displays only top-level user fields, such as birthDate. To display a field in user.data, use FreeMarker directly: ${user.data.favColor}. To handle defaults or format the value, use the FreeMarker built-in functions.

Save the theme, and assign the theme to the tenant or the Application. For more information, see Apply a Theme and Application-Specific Themes.

Reload the Account URL. The account home page shows the Birthdate field:

The account page showing the customized Birthdate field.