Passcode

Functions to manage passcode in the app.

You'll need to import the javascript file in your website before starting from this linkarrow-up-right.

Set Passcode

Creates or updates a user's passcode with an optional reauthentication step.

window.WTN.Passcode.setPasscode({ reauthenticate: true });

Parameter:

Key
Type
Description

reauthenticate

Boolean

If true, the user must enter their existing password before setting or changing the passcode. If false, the passcode can be set without asking for the existing password.

When reauthentication is enabled, the function prompts for the current password before proceeding. Otherwise, it goes directly to passcode setup.


Reset Passcode

Resets the user's passcode with optional app data cleanup.

window.WTN.Passcode.resetPasscode({ resetAppData: false });

Parameter:

Key
Type
Description

resetAppData

Boolean

If true, all application data is cleared along with the passcode. If false, only the passcode-related data is cleared and the rest of the app data remains intact.

Depending on the value of resetAppData, this either performs a full app data reset or limits the reset to passcode information only.