Bug 1453507 - Fix and simplify TPS's logout procedure r=eoger

MozReview-Commit-ID: CvnXAT0nanB

--HG--
extra : rebase_source : 00736a60200a1a4c6895493836709a5cacb156c2
This commit is contained in:
Thom Chiovoloni 2018-04-11 15:40:17 -07:00
Родитель 3a0bca5c18
Коммит 7be53b64d3
1 изменённых файлов: 3 добавлений и 8 удалений

Просмотреть файл

@ -191,17 +191,12 @@ var Authentication = {
},
/**
* Sign out of Firefox Accounts. It also clears out the device ID, if we find one.
* Sign out of Firefox Accounts.
*/
async signOut() {
if (await Authentication.isLoggedIn()) {
let user = await Authentication.getSignedInUser();
if (!user) {
throw new Error("Failed to get signed in user!");
}
let { sessionToken } = user;
let fxc = new FxAccountsClient();
await fxc.signOut(sessionToken, { service: "sync" });
// Note: This will clean up the device ID.
await fxAccounts.signOut();
}
}
};