Files
itflow/js/logins_show_otp_via_id.js
Marcus Hill ba0917e142 Logins JS Cleanup
- Remove old JS
- Standardize generate password JS style to match existing
- Move JS functions to own files
2024-01-22 21:25:21 +00:00

17 lines
481 B
JavaScript

function showOTPViaLoginID(login_id) {
// Send a GET request to ajax.php as ajax.php?get_totp_token_via_id=true&login_id=ID
jQuery.get(
"ajax.php", {
get_totp_token_via_id: 'true',
login_id: login_id
},
function(data) {
//If we get a response from post.php, parse it as JSON
const token = JSON.parse(data);
document.getElementById("otp_" + login_id).innerText = token
}
);
}