Update OTP endpoint and version info in totp.js

Changed the OTP API endpoint from '/tfa/otp' to '/otp' and updated VERSIONINFO to 1.0.1. Improved example comments to clarify key formats and OTP code usage.
This commit is contained in:
Namhyeon Go 2025-08-22 17:59:32 +09:00
parent dfc18cfd7d
commit d443f6270c

View File

@ -24,7 +24,7 @@ function getOtp(pubkey) {
.setRequestBody({
"secret": pubkey
})
.open("POST", TFA_API_BASE_URL + "/tfa/otp")
.open("POST", TFA_API_BASE_URL + "/otp")
.send()
.responseBody
;
@ -34,7 +34,7 @@ function getOtp(pubkey) {
exports.getPubKey = getPubKey;
exports.getOtp = getOtp;
exports.VERSIONINFO = "Time-based OTP client (totp.js) version 1.0";
exports.VERSIONINFO = "Time-based OTP client (totp.js) version 1.0.1";
exports.AUTHOR = "gnh1201@catswords.re.kr";
exports.global = global;
exports.require = global.require;
@ -42,6 +42,7 @@ exports.require = global.require;
/*
// Example:
var TOTP = require("lib/totp");
console.log(TOTP.getPubKey()); // get public key. e.g. 6Y4R 3AQN 4TTV CEQT
console.log(TOTP.getOtp('6Y4R 3AQN 4TTV CEQT')); // get OTP code. e.g. 317884
console.log(TOTP.getPubKey()); // get public key. e.g. ih6vdfuh75ugdcmruaexhfh3miiwdqhx
console.log(TOTP.getOtp('ih6vdfuh75ugdcmruaexhfh3miiwdqhx')); // get OTP code. (32 characters key) e.g. 774372
console.log(TOTP.getOtp('6Y4R 3AQN 4TTV CEQT')); // get OTP code. (16 characters key) e.g. 317884
*/