From 096b5496b3c2bf1cf9d6a645bd50ce040c3f80b6 Mon Sep 17 00:00:00 2001 From: Igor Serebryany Date: Fri, 6 Oct 2023 15:12:29 -0700 Subject: [PATCH] clarify password changes for local auth users --- client/pages/account.vue | 26 +++++++++++++++++++++----- client/strings/en-us.json | 1 + 2 files changed, 22 insertions(+), 5 deletions(-) diff --git a/client/pages/account.vue b/client/pages/account.vue index 18b5cdecf..beb13fc3f 100644 --- a/client/pages/account.vue +++ b/client/pages/account.vue @@ -20,14 +20,17 @@

{{ $strings.HeaderChangePassword }}

+ +

{{ $strings.NoteChangeProxyPassword }}

+
- + - +

* {{ $strings.NoteChangeRootPassword }}

- {{ $strings.ButtonSubmit }} + {{ $strings.ButtonSubmit }}
@@ -68,7 +71,20 @@ export default { }, isGuest() { return this.usertype === 'guest' - } + }, + isFromProxy() { + return this.user.isFromProxy + }, + canSubmitPwChange() { + if (this.isGuest) return false; + if (this.isRoot) return true; + + if (!this.password && !this.isFromProxy) return false; + if (!this.newPassword && !this.isRoot) return false; + if (!this.confirmPassword && !this.isFromProxy) return false; + + return true + }, }, methods: { updateLocalLanguage(lang) { @@ -96,7 +112,7 @@ export default { this.confirmPassword = null }, submitChangePassword() { - if (this.newPassword !== this.confirmPassword) { + if (this.newPassword !== this.confirmPassword && !this.isFromProxy) { return this.$toast.error('New password and confirm password do not match') } if (this.password === this.newPassword) { diff --git a/client/strings/en-us.json b/client/strings/en-us.json index c04d29c5f..7957c47db 100644 --- a/client/strings/en-us.json +++ b/client/strings/en-us.json @@ -635,6 +635,7 @@ "MessageXLibraryIsEmpty": "{0} Library is empty!", "MessageYourAudiobookDurationIsLonger": "Your audiobook duration is longer than the duration found", "MessageYourAudiobookDurationIsShorter": "Your audiobook duration is shorter than duration found", + "NoteChangeProxyPassword": "The password you configure here will not work with this website. It is only needed for the Audiobookshelf mobile app.", "NoteChangeRootPassword": "Root user is the only user that can have an empty password", "NoteChapterEditorTimes": "Note: First chapter start time must remain at 0:00 and the last chapter start time cannot exceed this audiobooks duration.", "NoteFolderPicker": "Note: folders already mapped will not be shown",