Skip to content

Commit 0c6a71c

Browse files
committed
Bug 1824112 - switch to addLoginAsync r=credential-management-reviewers,sgalich,sync-reviewers,markh
Differential Revision: https://phabricator.services.mozilla.com/D175666
1 parent 2b919a8 commit 0c6a71c

File tree

4 files changed

+6
-3
lines changed

4 files changed

+6
-3
lines changed

services/fxaccounts/FxAccountsStorage.sys.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -562,7 +562,7 @@ LoginManagerStorage.prototype = {
562562
if (existingLogins.length) {
563563
Services.logins.modifyLogin(existingLogins[0], login);
564564
} else {
565-
Services.logins.addLogin(login);
565+
await Services.logins.addLoginAsync(login);
566566
}
567567
log.trace("finished write of user data to the login manager");
568568
} catch (ex) {

services/sync/modules/engines/passwords.sys.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -346,7 +346,7 @@ PasswordStore.prototype = {
346346
"formSubmitURL: " +
347347
JSON.stringify(login.formActionOrigin)
348348
);
349-
Services.logins.addLogin(login);
349+
await Services.logins.addLoginAsync(login);
350350
},
351351

352352
async remove(record) {

services/sync/tps/extensions/tps/resource/modules/passwords.sys.mjs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@ Password.prototype = {
9999
this.props.usernameField,
100100
this.props.passwordField
101101
);
102+
// TODO: use `addLoginAsync` instead, see https://bugzilla.mozilla.org/show_bug.cgi?id=1829396
102103
Services.logins.addLogin(login);
103104
login.QueryInterface(Ci.nsILoginMetaInfo);
104105
return login.guid;

toolkit/components/passwordmgr/LoginManagerParent.sys.mjs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1414,7 +1414,9 @@ export class LoginManagerParent extends JSWindowActorParent {
14141414
existingLogin.password = formLogin.password;
14151415
} else if (!autoSavedLogin) {
14161416
lazy.log("Auto-saving new login with empty username.");
1417-
existingLogin = Services.logins.addLogin(formLoginWithoutUsername);
1417+
existingLogin = await Services.logins.addLoginAsync(
1418+
formLoginWithoutUsername
1419+
);
14181420
// Remember the GUID where we saved the generated password so we can update
14191421
// the login if the user later edits the generated password.
14201422
generatedPW.storageGUID = existingLogin.guid;

0 commit comments

Comments
 (0)