aslilogin
v1.0.2
Published
AsliLogin Web SDK
Downloads
5
Maintainers
Readme
ASLI Login - Web SDK
Description
The AsliLogin Web SDK enables you to add FIDO2 certified multi-factor authentication to your web-based application all the while having full control over the user experience with no redirection to pages outside your application.
Check out the AsliLogin SDK for a simplified integration.
Install Library via NPM
npm i aslilogin --save
Register via NodeJs / Typescript :
import { registration } from "aslilogin/sdk";
const handleSignup = async (event) => {
event.preventDefault();
const email = "[email protected]";
let registerInitial = new registration.AsliLoginRegistration({
token: "token received by ASLIRI",
});
const registerProcess = await registerInitial.registerWithPasswordLess(email);
// you can show up response from process
console.log({ registerProcess });
// your code for handle
// example
if (registerProcess.status === "success") {
//
console.log("verify status", registerProcess.verified);
}
};
HTML:
<button onClick={(event) => handleSignUp(event)} type="button">Sign Up</button>
Console Result:
registerProcess{
message: "message",
status: "success" | "error",
verified: boolean
}
Login via NodeJs / Typescript :
import { authenticate } from "aslilogin/sdk";
const handleSignin = async (event) => {
event.preventDefault();
const email = "[email protected]";
let loginInitial = new authenticate.AsliLoginAuthentication({
token: "token received by ASLIRI",
});
const loginProcess = await loginInitial.loginWithPasswordLess(email);
// you can show up response from process
console.log({ loginProcess });
// your code for handle
// example
if (loginProcess.status === "success") {
//
}
};
HTML:
<button onClick={(event) => handleSignin(event)} type="button">Sign Up</button>
Console Result:
loginProcess{
message: "message",
status: "success" | "error",
verified: boolean
}