CHANGE generated password change to nnnn pin to allow easier communication for temporary work #15

This commit is contained in:
Caffeine Fueled 2026-03-02 21:39:03 +01:00
parent 60d3219f7e
commit 2489807158
Signed by: cf7
GPG key ID: CA295D643074C68C

5
app.py
View file

@ -262,10 +262,9 @@ function setPassword() {
} }
function genPassword() { function genPassword() {
const chars = "ABCDEFGHJKLMNPQRSTUVWXYZabcdefghjkmnpqrstuvwxyz23456789"; const arr = new Uint32Array(1);
const arr = new Uint32Array(10);
crypto.getRandomValues(arr); crypto.getRandomValues(arr);
const pw = Array.from(arr, n => chars[n % chars.length]).join(""); const pw = String(arr[0] % 10000).padStart(4, "0");
$("#pw-input").value = pw; $("#pw-input").value = pw;
$("#pw-input").type = "text"; $("#pw-input").type = "text";
$("#pw-msg").textContent = "Copy this password before setting it."; $("#pw-msg").textContent = "Copy this password before setting it.";