showAccountRecovery

client.showAccountRecovery({
  container: HTMLElement|id,
  // Optional arguments
  loginLink: string,
  allowCreatePassword: boolean,
  onReady: function,
  theme: object,
  i18n: object
})

Description

Show the widget for the account recovery process. Currently, this is for resetting a passkey.

Examples

client.showAccountRecovery({
  container: 'webauthn-devices-container',
  loginLink: 'https://www.example.com/auth-callback',
  allowCreatePassword: true,
  onReady: instance => {
    // Destroy the widget
    // if (...) instance.destroy()
  },
  theme: { primaryColor: '#274890' },
  i18n: {
    email: 'Email'
  }
})

Widget

showAccountRecovery

Parameters

allowCreatePassword boolean

Boolean to display the option to create a password in the widget.

The text is usually "Or create a password".

Defaults to true.

container HTMLElement id

The DOM element or the id of a DOM element in which the widget should be embedded.

i18n object

Widget labels and error messages to override. Falls back to the default wordings in en, fr, es, it and nl.

You might re-word the socialAccounts.linkNewAccount or change the way other wordings display to the user while leaving the remaining text on the widget intact.

loginLink string

The URL to which the user is redirected after a password reset.

onReady function

Callback function called after the widget has been successfully loaded and rendered inside the container. The callback is called with the widget instance.

theme object

The options to set up to customize the appearance of the widget.

Below is an example of some of the theme attributes.

For a full list, see theme attributes.

primaryColor string

The button and link default color.

Defaults to #229955.

borderRadius string

The radius of the social login button and other input (in px).

This can be used to make inline and/or circle social login buttons.

Defaults to 3.

socialButton object

Social button theming options.

Parameters
  • inline- Boolean that specifies if the buttons are inline (horizonally-aligned).

  • textVisible - Boolean that specifies if the text is visible.

  • fontWeight - Specifies the font-weight (such as normal, bold, or 900).

  • fontSize - Specifies the font-size.

  • lineHeight - Specifies the line-height.

  • paddingX - Specifies the padding for the x axis. (left and right)

  • paddingY - Specifies the padding for the y axis. (top and bottom)

  • borderRadius - Specifies the border-radius.

  • borderWidth - Specifies the border-width.

  • focusBoxShadow - Boolean that specifies if there is a box shadow on the button or not.

theme attributes

base

attribute

animateWidgetEntrance

fontSize

smallTextFontSize

lineHeight

headingColor

textColor

mutedTextColor

borderRadius

borderColor

borderWidth

backgroundColor

primaryColor

dangerColor

warningColor

successColor

lightBackgroundColor

maxWidth

paddingY

paddingX

spacing

_absoluteLineHeight

_blockInnerHeight

_blockHeight

link

color

decoration

hoverColor

hoverDecoration

input

color

placeholderColor

background

disabledBackground

boxShadow

focusBoxShadow

fontSize

lineHeight

paddingX

paddingY

borderRadius

borderColor

borderWidth

focusBorderColor

height

button

fontWeight

fontSize

lineHeight

paddingX

paddingY

borderRadius

borderWidth

focusBoxShadow

height

socialButton

inline

textVisible

fontWeight

fontSize

lineHeight

paddingX

paddingY

borderRadius

borderWidth

focusBoxShadow

height

passwordStrengthValidator

color0

color1

color2

color3

color4