js-passcode
v1.0.0
Published
This is a custom element V1-based Passcode authentication.
Downloads
2
Maintainers
Readme
js-passcode
This is a custom element V1-based Passcode authentication.
Examples
There are some examples in "./examples" in this package.Here is the first one to get you started.
Installation
npm install js-passcode;
Usage
Add passcode element to HTML.
<js-passcode id="passcode"></js-passcode>
Perform passcode authentication with JS.
import 'js-passcode';
// Correct passcode
const correctPasscode = '1234';
// Passcode authentication
document.querySelector('#passcode').authenticate(correctPasscode, success => {
// If the passcode is correct, the callback function argument returns true.
if (success) alert('Authenticated Successfully');
else alert('Authentication Failed');
});