Fix authsave to save both username and password (#390)

Update do_authsave() to call psync_set_user_pass() instead of
psync_set_pass(), ensuring both username and password are persisted.

Co-authored-by: Levi Neely <lkn@darkstar.example.net>
This commit is contained in:
Levi Neely 2026-03-11 22:39:08 +01:00 committed by GitHub
parent 59a1a772e6
commit bf11ae3490
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 1 deletions

View File

@ -192,7 +192,8 @@ int clib::pclsync_lib::receive_auth(const char *pass) {
} }
int clib::pclsync_lib::receive_auth_save(const char *pass) { int clib::pclsync_lib::receive_auth_save(const char *pass) {
psync_set_pass(pass, 1); const char *username = get_lib().username_.c_str();
psync_set_user_pass(username, pass, 1);
pthread_mutex_lock(&auth_mtx); pthread_mutex_lock(&auth_mtx);
get_lib().password_ = std::string(pass); get_lib().password_ = std::string(pass);
pthread_cond_signal(&auth_cond); pthread_cond_signal(&auth_cond);