offlinelogin
v1.0.4
Published
offline sign up and sign in
Downloads
12
Maintainers
Readme
Offline sign up and sign in
let user = index.registerUser(account, password, birthday, issuer);
console.log('registerUser', user)
console.log('offlineLogin', index.offlineLogin(user, password))
let totp = index.registerTotp(user);
console.log('registerTotp',totp);
qrcode.generate(totp.secretUrl);
prompt.start();
user = await (new Promise(resolive => {
prompt.get(['token'], function (err, result) {
let token = result.token;
resolive(totp.checktokenToken(password, token));
});
}))
console.log('totp.checktokenToken', user)
let verifyLoginTotp = index.offlineLogin(user, password)
console.log('offlineLogin', verifyLoginTotp)
prompt.start();
let ret = await (new Promise(resolive => {
prompt.get(['token'], function (err, result) {
let token = result.token;
resolive(verifyLoginTotp(token));
});
}))
console.log('verifyLoginTotp', ret)