From 276f120b607e1ee6ad973679092d8ea5240fc631 Mon Sep 17 00:00:00 2001 From: h44z Date: Mon, 9 Nov 2026 19:57:23 +0100 Subject: [PATCH] feat(auth): require changing default admin password (#778) --- frontend/src/App.vue | 7 + .../src/components/DefaultPasswordModal.vue | 150 ++++++++++++++++++ frontend/src/helpers/fetch-wrapper.js | 3 +- frontend/src/helpers/websocket-wrapper.js | 9 +- frontend/src/lang/translations/de.json | 17 ++ frontend/src/lang/translations/en.json | 17 ++ frontend/src/router/index.js | 5 + frontend/src/stores/auth.js | 24 ++- frontend/src/views/LoginView.vue | 38 +++-- frontend/src/views/SettingsView.vue | 3 +- internal/app/api/v0/handlers/base.go | 2 + .../app/api/v0/handlers/endpoint_audit.go | 1 + .../v0/handlers/endpoint_authentication.go | 44 ++--- .../endpoint_authentication_basepath_test.go | 3 + .../api/v0/handlers/endpoint_interfaces.go | 1 + .../app/api/v0/handlers/endpoint_peers.go | 1 + .../app/api/v0/handlers/endpoint_testing.go | 5 +- .../app/api/v0/handlers/endpoint_users.go | 28 ++-- .../app/api/v0/handlers/endpoint_websocket.go | 2 +- .../app/api/v0/handlers/web_authentication.go | 16 ++ .../v0/handlers/web_authentication_test.go | 82 ++++++++++ internal/app/api/v0/handlers/web_session.go | 27 ++-- .../app/api/v0/model/models_authentication.go | 13 +- internal/app/api/v0/model/models_user.go | 43 ++--- .../app/api/v1/handlers/web_authentication.go | 7 + .../v1/handlers/web_authentication_test.go | 39 ++++- internal/app/auth/auth.go | 7 + internal/app/users/default_password_test.go | 100 ++++++++++++ internal/app/users/user_manager.go | 28 ++++ internal/config/config.go | 9 +- 30 files changed, 641 insertions(+), 90 deletions(-) create mode 100644 frontend/src/components/DefaultPasswordModal.vue create mode 100644 internal/app/api/v0/handlers/web_authentication_test.go create mode 100644 internal/app/users/default_password_test.go diff --git a/frontend/src/App.vue b/frontend/src/App.vue index d4c7fe5e..33b2b1e0 100644 --- a/frontend/src/App.vue +++ b/frontend/src/App.vue @@ -6,6 +6,7 @@ import { authStore } from "./stores/auth"; import { securityStore } from "./stores/security"; import { settingsStore } from "@/stores/settings"; import { Notifications } from "@kyvg/vue3-notification"; +import DefaultPasswordModal from "@/components/DefaultPasswordModal.vue"; const appGlobal = getCurrentInstance().appContext.config.globalProperties const auth = authStore() @@ -197,9 +198,15 @@ const userDisplayName = computed(() => {
+
+

{{ $t('default-password.banner-title') }}

+

{{ $t('default-password.banner-message') }}

+
+ +