[GH-ISSUE #341] Logging in after changing password leads to broken settings #293

Closed
opened 2026-02-25 21:34:40 +03:00 by kerem · 8 comments
Owner

Originally created by @HanPrower on GitHub (Apr 26, 2019).
Original GitHub issue: https://github.com/cypht-org/cypht/issues/341

Originally assigned to: @IrAlfred, @Baraka24 on GitHub.

🐛 Bugreport

After changing account password with php ./scripts/update_password.php username password can't login without deleting cookies. Once logged in settings of account no longer seem to be attached.

Changing the password back to what it was before allows settings to load correctly.

I see no way to change the password internally.

Version & Environment

Commit: github.com/jasonmunro/cypht@8f76381981
OS: Arch Linux (rolling)
Auth: Database (mariadb) + Redis
Environment:

PHP version	7.3.4
Zend version	3.3.4
SAPI	fpm-fcgi
Enabled Modules	core, pop3, imap, smtp, account, idle_timer, desktop_notifications, themes, nux, developer, history, saved_searches, advanced_search, profiles, inline_message, imap_folders, keyboard_shortcuts

Steps to reproduce

  1. Make account and set up some settings, save & logout
  2. Change password using php ./scripts/update_password.php username password (the password hash in the db does change)
  3. Try and login; prompted is wrong
  4. Delete cookies and login again; this time it logs in
  5. Notice any saved settings are missing (general, email servers, etc.)
  6. Use script to set password back to what it was, delete cookies and login and settings are back

I did see https://github.com/jasonmunro/cypht/issues/98, but it doesn't seem relevant to this.

Originally created by @HanPrower on GitHub (Apr 26, 2019). Original GitHub issue: https://github.com/cypht-org/cypht/issues/341 Originally assigned to: @IrAlfred, @Baraka24 on GitHub. ## 🐛 Bugreport After changing account password with` php ./scripts/update_password.php username password` can't login without deleting cookies. Once logged in settings of account no longer seem to be attached. Changing the password back to what it was before allows settings to load correctly. I see no way to change the password internally. ### Version & Environment Commit: https://github.com/jasonmunro/cypht/commit/8f76381981376fc5b045c3bda37acaa3f434bf87 OS: Arch Linux (rolling) Auth: Database (mariadb) + Redis Environment: ``` PHP version 7.3.4 Zend version 3.3.4 SAPI fpm-fcgi Enabled Modules core, pop3, imap, smtp, account, idle_timer, desktop_notifications, themes, nux, developer, history, saved_searches, advanced_search, profiles, inline_message, imap_folders, keyboard_shortcuts ``` ### Steps to reproduce 1. Make account and set up some settings, save & logout 2. Change password using `php ./scripts/update_password.php username password` (the password hash in the db does change) 3. Try and login; prompted is wrong 4. Delete cookies and login again; this time it logs in 5. Notice any saved settings are missing (general, email servers, etc.) 6. Use script to set password back to what it was, delete cookies and login and settings are back I did see https://github.com/jasonmunro/cypht/issues/98, but it doesn't seem relevant to this.
kerem closed this issue 2026-02-25 21:34:40 +03:00
Author
Owner

@jasonmunro commented on GitHub (May 6, 2019):

Hello, thanks for the feedback. A couple thoughts:

  • When using built in authentication you should have a Settings -> Password page in the main menu that allows you to change your password without losing your settings.
  • It's a known issue that changing your password externally from Cypht (including the cli script, which I sort of forgot about), causes settings to be lost. There is a recover_settings module set however that you can enable to recover those presuming the old password is still known.

We could also improve that cli script to take both the old and new password so that it can decrypt then re-encrypt settings so this does not happen when using it.

<!-- gh-comment-id:489760253 --> @jasonmunro commented on GitHub (May 6, 2019): Hello, thanks for the feedback. A couple thoughts: - When using built in authentication you should have a Settings -> Password page in the main menu that allows you to change your password without losing your settings. - It's a known issue that changing your password externally from Cypht (including the cli script, which I sort of forgot about), causes settings to be lost. There is a recover_settings module set however that you can enable to recover those presuming the old password is still known. We could also improve that cli script to take both the old and new password so that it can decrypt then re-encrypt settings so this does not happen when using it.
Author
Owner

@HanPrower commented on GitHub (May 7, 2019):

Hm, not sure how I missed the Settings -> Password. I swear it wasn't there before... probably just blind.

When you do use that form, however, it does throw an error. When looking at the error log it seems related to a missing translation. The password does change though.

<!-- gh-comment-id:489980492 --> @HanPrower commented on GitHub (May 7, 2019): Hm, not sure how I missed the Settings -> Password. I swear it wasn't there before... probably just blind. When you do use that form, however, it does throw an error. When looking at the error log it seems related to a missing translation. The password does change though.
Author
Owner

@jasonmunro commented on GitHub (May 7, 2019):

We log missing translations as a way to easily know what needs to be added to the translation files, but those messages are information only and will not cause bad behavior (aside from not being translated properly).

<!-- gh-comment-id:490109703 --> @jasonmunro commented on GitHub (May 7, 2019): We log missing translations as a way to easily know what needs to be added to the translation files, but those messages are information only and will not cause bad behavior (aside from not being translated properly).
Author
Owner

@marclaporte commented on GitHub (Feb 27, 2021):

Lost settings reminds me of https://github.com/jasonmunro/cypht/issues/349

<!-- gh-comment-id:786967681 --> @marclaporte commented on GitHub (Feb 27, 2021): Lost settings reminds me of https://github.com/jasonmunro/cypht/issues/349
Author
Owner

@marclaporte commented on GitHub (Mar 9, 2021):

Likely fixed by github.com/jasonmunro/cypht@0eef136450

<!-- gh-comment-id:794455812 --> @marclaporte commented on GitHub (Mar 9, 2021): Likely fixed by https://github.com/jasonmunro/cypht/commit/0eef1364503158b4ef7b058eda07ab7f9a4b63c5
Author
Owner

@jasonmunro commented on GitHub (Mar 9, 2021):

Likely fixed by 0eef136

unfortunately it will not effect that. The CLI script will need quite a bit more work to correctly maintain the settings on password change including the requirement that the old password be submitted as an argument

<!-- gh-comment-id:794567270 --> @jasonmunro commented on GitHub (Mar 9, 2021): > Likely fixed by [0eef136](https://github.com/jasonmunro/cypht/commit/0eef1364503158b4ef7b058eda07ab7f9a4b63c5) unfortunately it will not effect that. The CLI script will need quite a bit more work to correctly maintain the settings on password change including the requirement that the old password be submitted as an argument
Author
Owner

@jasonmunro commented on GitHub (Mar 10, 2021):

I am going to keep this open as it is legit - however it is not a bug as I built this as a last resort for restoring login. We can address this over time (changing passwords in the app successfully converts settings for non-emergency situations) but not hold up new releases :)

<!-- gh-comment-id:794785208 --> @jasonmunro commented on GitHub (Mar 10, 2021): I am going to keep this open as it is legit - however it is not a bug as I built this as a last resort for restoring login. We can address this over time (changing passwords in the app successfully converts settings for non-emergency situations) but not hold up new releases :)
Author
Owner

@marclaporte commented on GitHub (May 7, 2024):

@HanPrower

Please retest, as a lot has changed since you reported this issue. Notably, we now have 3 active branches and recently released Cypht 2.0.0

<!-- gh-comment-id:2097128369 --> @marclaporte commented on GitHub (May 7, 2024): @HanPrower Please retest, as a lot has changed since you reported this issue. Notably, we now have 3 active branches and recently released Cypht 2.0.0 - https://github.com/cypht-org/cypht/releases/tag/v2.0.0 - https://github.com/cypht-org/cypht/wiki/Lifecycle
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/cypht#293
No description provided.