зеркало из https://github.com/mozilla/gecko-dev.git
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:
Родитель
3a0bca5c18
Коммит
7be53b64d3
|
@ -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();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
|
Загрузка…
Ссылка в новой задаче