Using the pre-built UI you can easily allow users to add authentication methods.

Adding backup authentication methods in the pre-built
UI

Adding backup authentication methods in the pre-built UI

Tracking actions to add backup authenticators

Passing redirectToSettings: true in the track request will mean that after completing a challenge with an existing authentication method, users will be redirected to a settings menu where they can add backup authentication methods.

const result = await authsignal.track({
  userId: user.id,
  action: "signIn",
  redirectUrl: "https://yourapp.com/callback",
  redirectToSettings: true,
});

const url = result.url;

When using the pre-built UI, for security reasons users will always have to complete a challenge with one of their existing authentication methods before they can add backups.

Retrieving a user’s enrollment status

If you want add a link or button to your profile page which can launch the pre-built UI to let users add backup authenticators, you may want to determine if the user is “enrolled” yet (i.e. they have already added at least one authentication method).

Get User lets you determine if a user is currently enrolled.

curl https://api.authsignal.com/v1/users/usr_123 \
  -u YOUR_SECRET_KEY:

Next steps