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:
|
else:
|
||||||
if not password:
|
if not password:
|
||||||
flash('Password is required when adding a credential.', 'error')
|
import secrets, string
|
||||||
conn.close()
|
password = ''.join(secrets.choice(string.ascii_lowercase + string.digits) for _ in range(8))
|
||||||
return redirect(f'/{_PAGE}')
|
flash(f"Auto-generated password for '{username}': {password}", 'success')
|
||||||
|
|
||||||
try:
|
try:
|
||||||
hashed = _hash_password(password, hash_type)
|
hashed = _hash_password(password, hash_type)
|
||||||
|
|
|
||||||
|
|
@ -89,6 +89,12 @@
|
||||||
"name": "row_index",
|
"name": "row_index",
|
||||||
"value": ""
|
"value": ""
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"type": "field",
|
||||||
|
"label": "Credential Active",
|
||||||
|
"name": "enabled",
|
||||||
|
"input_type": "checkbox"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"type": "field_row",
|
"type": "field_row",
|
||||||
"cols": 2,
|
"cols": 2,
|
||||||
|
|
@ -106,7 +112,7 @@
|
||||||
"label": "Password",
|
"label": "Password",
|
||||||
"name": "password",
|
"name": "password",
|
||||||
"input_type": "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": "hr"
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"type": "field",
|
|
||||||
"label": "Enabled",
|
|
||||||
"name": "enabled",
|
|
||||||
"input_type": "checkbox"
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"type": "field_row",
|
"type": "field_row",
|
||||||
"cols": 2,
|
"cols": 2,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue