mirror of
https://github.com/gnh1201/welsonjs.git
synced 2025-05-15 06:01:04 +00:00
Update totp.js
This commit is contained in:
parent
2ac75fd24e
commit
27f4dc2084
49
lib/totp.js
49
lib/totp.js
|
@ -11,34 +11,39 @@
|
||||||
var JsonRpc2 = require("lib/jsonrpc2");
|
var JsonRpc2 = require("lib/jsonrpc2");
|
||||||
|
|
||||||
function getPubKey() {
|
function getPubKey() {
|
||||||
var rpc = JsonRpc2.create("https://public-api.catswords.net");
|
var rpc = JsonRpc2.create("https://public-api.catswords.net");
|
||||||
var result = rpc.invoke("relay_invoke_method", {
|
var result = rpc.invoke("relay_invoke_method", {
|
||||||
"method": "load_script",
|
"method": "load_script",
|
||||||
"requires": [
|
"requires": [
|
||||||
"https://raw.githubusercontent.com/dimamedia/PHP-Simple-TOTP-and-PubKey/refs/heads/master/class.tfa.php"
|
"https://raw.githubusercontent.com/dimamedia/PHP-Simple-TOTP-and-PubKey/refs/heads/master/class.tfa.php"
|
||||||
],
|
],
|
||||||
"args": [
|
"args": [
|
||||||
"$tfa = new tfa(); return $tfa->getPubKey()"
|
"$tfa = new tfa(); return $tfa->getPubKey()"
|
||||||
]
|
]
|
||||||
}, "");
|
}, "");
|
||||||
|
|
||||||
return result.data;
|
return result.data;
|
||||||
}
|
}
|
||||||
|
|
||||||
function getOtp() {
|
function getOtp() {
|
||||||
var rpc = JsonRpc2.create("https://public-api.catswords.net");
|
var rpc = JsonRpc2.create("https://public-api.catswords.net");
|
||||||
var result = rpc.invoke("relay_invoke_method", {
|
var result = rpc.invoke("relay_invoke_method", {
|
||||||
"method": "load_script",
|
"method": "load_script",
|
||||||
"requires": [
|
"requires": [
|
||||||
"https://raw.githubusercontent.com/dimamedia/PHP-Simple-TOTP-and-PubKey/refs/heads/master/class.tfa.php"
|
"https://raw.githubusercontent.com/dimamedia/PHP-Simple-TOTP-and-PubKey/refs/heads/master/class.tfa.php"
|
||||||
],
|
],
|
||||||
"args": [
|
"args": [
|
||||||
"$tfa = new tfa(); return $tfa->getOtp()"
|
"$tfa = new tfa(); return $tfa->getOtp()"
|
||||||
]
|
]
|
||||||
}, "");
|
}, "");
|
||||||
|
|
||||||
return result.data;
|
return result.data;
|
||||||
}
|
}
|
||||||
|
|
||||||
exports.getPubKey = getPubKey;
|
exports.getPubKey = getPubKey;
|
||||||
exports.getOtp = getOtp;
|
exports.getOtp = getOtp;
|
||||||
|
|
||||||
|
exports.VERSIONINFO = "TOTP library (totp.js) version 0.1";
|
||||||
|
exports.AUTHOR = "abuse@catswords.net";
|
||||||
|
exports.global = global;
|
||||||
|
exports.require = global.require;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user