1
0
Fork 0
mirror of synced 2024-09-19 18:59:06 +12:00

Set password to 12 characters (#14478)

This commit is contained in:
melohagan 2024-08-30 10:16:16 +01:00 committed by GitHub
parent d9e34ba056
commit 4d9f87e4c4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -7,7 +7,15 @@
export let user
const password = Math.random().toString(36).slice(2, 20)
const generatePassword = length => {
const array = new Uint8Array(length)
crypto.getRandomValues(array)
return Array.from(array, byte => byte.toString(36).padStart(2, "0"))
.join("")
.slice(0, length)
}
const password = generatePassword(12)
async function resetPassword() {
try {