1.2.7 • Published 1 year ago
js-google-authenticator v1.2.7
Javascript-Google-Authenticator
Javascript Google Authenticator
2 step verification function library with Google Authenticator
İmportant!
/*
* Since the verifyCode function accepts every code...
* ...entered, it is under maintenance.
* @
* Other functions are working.
*/
Call the package first
const authenticator = require("js-google-authenticator");
const authenticator = new GoogleAuthenticator();
Define keys
// Use the GoogleAuthenticator class methods
const secretKey = "YOUR_SECRET_KEY";
const code = "123456";
How to create a secret key?
const secretKey = authenticator.encode(text);
How to validate a key?
const isValid = authenticator.verifyCode(secretKey, code);
console.log(`Code valid: ${isValid}`);
How to create a otp key?
// not neccessary actually
const hotpCode = authenticator.generateHOTP(secretKey, 1234567890);
console.log(`HOTP code: ${hotpCode}`);
// for qr code:
const app = authenticator.forApp(string, secretKey);
console.log(`Google Authenticator App Otp Link: ${app}`);
You wanna support me? https://buymeacoffee.com/oxcakmak
1.2.7
1 year ago
1.2.6
1 year ago
1.2.5
1 year ago
1.2.4
1 year ago
1.2.3
1 year ago
1.2.2
1 year ago
1.2.1
1 year ago
1.2.0
1 year ago
1.1.9
1 year ago
1.1.8
1 year ago
1.1.7
1 year ago
1.1.6
1 year ago
1.1.5
1 year ago
1.1.4
1 year ago
1.1.3
1 year ago
1.1.2
1 year ago
1.1.1
1 year ago
1.1.0
1 year ago
1.0.9
1 year ago
1.0.8
1 year ago
1.0.7
1 year ago
1.0.6
1 year ago
1.0.5
1 year ago
1.0.4
1 year ago
1.0.3
1 year ago
1.0.2
1 year ago
1.0.1
1 year ago