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:
parent
59a1a772e6
commit
bf11ae3490
|
|
@ -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);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue