Development
This commit is contained in:
parent
1ea64ec00b
commit
8bd5d022e0
2 changed files with 10 additions and 10 deletions
|
|
@ -237,9 +237,9 @@ def addedit():
|
|||
|
||||
else:
|
||||
if not password:
|
||||
flash('Password is required when adding a credential.', 'error')
|
||||
conn.close()
|
||||
return redirect(f'/{_PAGE}')
|
||||
import secrets, string
|
||||
password = ''.join(secrets.choice(string.ascii_lowercase + string.digits) for _ in range(8))
|
||||
flash(f"Auto-generated password for '{username}': {password}", 'success')
|
||||
|
||||
try:
|
||||
hashed = _hash_password(password, hash_type)
|
||||
|
|
|
|||
|
|
@ -89,6 +89,12 @@
|
|||
"name": "row_index",
|
||||
"value": ""
|
||||
},
|
||||
{
|
||||
"type": "field",
|
||||
"label": "Credential Active",
|
||||
"name": "enabled",
|
||||
"input_type": "checkbox"
|
||||
},
|
||||
{
|
||||
"type": "field_row",
|
||||
"cols": 2,
|
||||
|
|
@ -106,7 +112,7 @@
|
|||
"label": "Password",
|
||||
"name": "password",
|
||||
"input_type": "password",
|
||||
"hint": "Leave blank when editing to keep the existing password. Changing hash type also requires a new password."
|
||||
"hint": "Leave blank to auto-generate password."
|
||||
}
|
||||
]
|
||||
},
|
||||
|
|
@ -145,12 +151,6 @@
|
|||
{
|
||||
"type": "hr"
|
||||
},
|
||||
{
|
||||
"type": "field",
|
||||
"label": "Enabled",
|
||||
"name": "enabled",
|
||||
"input_type": "checkbox"
|
||||
},
|
||||
{
|
||||
"type": "field_row",
|
||||
"cols": 2,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue