Repository navigation
Fix: clear the stored password when protection is turned off - #30
Merged
Merged
Conversation
Disabling Password Protection only flipped settings.auth.enabled. The hash stayed on disk, where it could not be replaced: set-password refuses while a hash exists unless the caller holds a session, no session can be obtained while auth is off, and login is a pure bypass that issues no cookie. A forgotten password could only be cleared by editing the config on the data volume. The hash also came back into force on re-enable, without the admin choosing it. Switching auth off now deletes the hash and the session secret, so tokens signed under it cannot be honoured if protection returns. The admin UI confirms before the save, drops its own passwordSet flag and shows the password as not set. Enabling still requires a stored password, so a cleared install must set a new one.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
settings.auth.passwordHashandsettings.auth.secretinPOST /api/auth/togglewhen the request disables auth, and audit the clear separately from the toggle.saveServer()before the first request of the save, so cancelling leaves every field unsaved and the stored password intact._passwordSetflag and the security row back to "Not set" after a successful disable, so re-enabling in the same session requires a new password.confirm.clearPasswordto all six locale catalogues.Testing
All green. Added 4 API tests covering the clear, the orphaned-hash recovery path, session invalidation and the no-password case; each was verified to fail without the fix.
Checklist