From 8bd5d022e050edb2a63f2449150ada452757fb74 Mon Sep 17 00:00:00 2001 From: Matthew Grotke Date: Sun, 7 Jun 2026 01:12:23 -0400 Subject: [PATCH] Development --- .../app/pages/clientcredentials/action.py | 6 +++--- .../app/pages/clientcredentials/content.json | 14 +++++++------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/docker/routlin-dash/app/pages/clientcredentials/action.py b/docker/routlin-dash/app/pages/clientcredentials/action.py index d02e680..c47a83d 100644 --- a/docker/routlin-dash/app/pages/clientcredentials/action.py +++ b/docker/routlin-dash/app/pages/clientcredentials/action.py @@ -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) diff --git a/docker/routlin-dash/app/pages/clientcredentials/content.json b/docker/routlin-dash/app/pages/clientcredentials/content.json index 43ecd87..3887d34 100644 --- a/docker/routlin-dash/app/pages/clientcredentials/content.json +++ b/docker/routlin-dash/app/pages/clientcredentials/content.json @@ -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,