feat(auth): require changing default admin password (#778)

This commit is contained in:
h44z
2026-11-09 19:57:23 +01:00
committed by GitHub
parent 137286d46b
commit 276f120b60
30 changed files with 641 additions and 90 deletions
+28 -10
View File
@@ -42,11 +42,20 @@ const login = async function () {
const dest = returnUrl.value && returnUrl.value !== '/login' ? returnUrl.value : (auth.ReturnUrl || '/')
auth.Login(username.value, password.value)
.then(uid => {
notify({
title: "Logged in",
text: "Authentication succeeded!",
type: 'success',
});
if (auth.DefaultPasswordInUse) {
notify({
title: "Default Password in Use!",
text: "Please change the default administrator password immediately. Unless the password gets changed, no further actions are possible.",
type: 'warn',
duration: 10000,
});
} else {
notify({
title: "Logged in",
text: "Authentication succeeded!",
type: 'success',
});
}
loggingIn.value = false;
settings.LoadSettings(); // reload full settings
auth.ResetReturnUrl();
@@ -71,11 +80,20 @@ const loginWebAuthn = async function () {
const dest = returnUrl.value && returnUrl.value !== '/login' ? returnUrl.value : (auth.ReturnUrl || '/')
auth.LoginWebAuthn()
.then(uid => {
notify({
title: "Logged in",
text: "Authentication succeeded!",
type: 'success',
});
if (auth.DefaultPasswordInUse) {
notify({
title: "Default Password in Use!",
text: "Please change the default administrator password immediately. Unless the password gets changed, no further actions are possible.",
type: 'warn',
duration: 10000,
});
} else {
notify({
title: "Logged in",
text: "Authentication succeeded!",
type: 'success',
});
}
loggingIn.value = false;
settings.LoadSettings(); // reload full settings
auth.ResetReturnUrl();
+2 -1
View File
@@ -57,6 +57,7 @@ const passwordChangeAllowed = computed(() => {
const updatePassword = async () => {
try {
await profile.changePassword(pwFormData.value);
auth.SetDefaultPasswordInUse(false);
pwFormData.value.OldPassword = '';
pwFormData.value.Password = '';
@@ -85,7 +86,7 @@ const updatePassword = async () => {
<p class="lead">{{ $t('settings.abstract') }}</p>
<div class="card border-secondary p-5 mt-5" v-if="profile.user.Source === 'db'">
<div class="card border-secondary p-5 mt-5" v-if="profile.user.AuthSources?.includes('db')">
<h2 class="display-7">{{ $t('settings.password.headline') }}</h2>
<p class="lead">{{ $t('settings.password.abstract') }}</p>
<hr class="my-4">