mirror of
https://github.com/itflow-org/itflow
synced 2026-02-28 19:04:52 +00:00
Logins JS Cleanup
- Remove old JS - Standardize generate password JS style to match existing - Move JS functions to own files
This commit is contained in:
14
js/logins_generate_password.js
Normal file
14
js/logins_generate_password.js
Normal file
@@ -0,0 +1,14 @@
|
||||
function generatePassword(login_id) {
|
||||
// Send a GET request to ajax.php as ajax.php?get_readable_pass=true
|
||||
jQuery.get(
|
||||
"ajax.php", {
|
||||
get_readable_pass: 'true'
|
||||
},
|
||||
function(data) {
|
||||
//If we get a response from post.php, parse it as JSON
|
||||
const password = JSON.parse(data);
|
||||
|
||||
document.getElementById("password").value = password;
|
||||
}
|
||||
);
|
||||
}
|
||||
16
js/logins_show_otp_via_id.js
Normal file
16
js/logins_show_otp_via_id.js
Normal file
@@ -0,0 +1,16 @@
|
||||
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
|
||||
|
||||
}
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user