Skip to content

Commit

Permalink
Set password to 12 characters (Budibase#14478)
Browse files Browse the repository at this point in the history
  • Loading branch information
melohagan authored Aug 30, 2024
1 parent d9e34ba commit 4d9f87e
Showing 1 changed file with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 4d9f87e

Please sign in to comment.