From d443f6270c255ffd19f59bae651af0f164271cfc Mon Sep 17 00:00:00 2001 From: "Namhyeon, Go" Date: Fri, 22 Aug 2025 17:59:32 +0900 Subject: [PATCH] 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. --- lib/totp.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/lib/totp.js b/lib/totp.js index 8acac05..fbedfdb 100644 --- a/lib/totp.js +++ b/lib/totp.js @@ -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 */