fix double password storage
This commit is contained in:
parent
62e5fce1f3
commit
5d949d4c0f
1 changed files with 19 additions and 9 deletions
|
@ -117,16 +117,26 @@ public class Audrey.Ui.Setup : Adw.PreferencesDialog {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public void save () {
|
private async void save_internal () {
|
||||||
this.authn_can_edit = false;
|
this.authn_can_edit = false;
|
||||||
Secret.password_store.begin (secret_schema, null, "Audrey Subsonic password", this.password, null, (obj, res) => {
|
|
||||||
try {
|
try {
|
||||||
Secret.password_store.end (res);
|
yield Secret.password_clear (secret_schema, null);
|
||||||
|
} catch (Error e) {
|
||||||
|
error ("could not clear previous passwords from keyring: %s", e.message);
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
yield Secret.password_store (secret_schema, null, "Audrey Subsonic password", this.password, null, "server-url", this.server_url, "username", this.username);
|
||||||
} catch (Error e) {
|
} catch (Error e) {
|
||||||
error ("could not store password in keyring: %s", e.message);
|
error ("could not store password in keyring: %s", e.message);
|
||||||
}
|
}
|
||||||
|
|
||||||
this.authn_can_edit = true;
|
this.authn_can_edit = true;
|
||||||
}, "server-url", this.server_url, "username", this.username);
|
}
|
||||||
|
|
||||||
|
public void save () {
|
||||||
|
this.save_internal.begin ();
|
||||||
}
|
}
|
||||||
|
|
||||||
~Setup () {
|
~Setup () {
|
||||||
|
|
Loading…
Reference in a new issue