Bug 1207840 - add '?service=sync' to the URL used when disconnecting from Sync. r=zaach

This commit is contained in:
Mark Hammond 2015-09-30 09:34:37 +10:00
parent 6ccc2beafb
commit 639d6c6d42
2 changed files with 10 additions and 3 deletions

View File

@ -653,7 +653,10 @@ FxAccountsInternal.prototype = {
},
_signOutServer: function signOutServer(sessionToken) {
return this.fxAccountsClient.signOut(sessionToken);
// For now we assume the service being logged out from is Sync - we might
// need to revisit this when this FxA code is used in a context that
// isn't Sync.
return this.fxAccountsClient.signOut(sessionToken, {service: "sync"});
},
/**

View File

@ -167,8 +167,12 @@ this.FxAccountsClient.prototype = {
* The session token encoded in hex
* @return Promise
*/
signOut: function (sessionTokenHex) {
return this._request("/session/destroy", "POST",
signOut: function (sessionTokenHex, options = {}) {
let path = "/session/destroy";
if (options.service) {
path += "?service=" + options.service;
}
return this._request(path, "POST",
deriveHawkCredentials(sessionTokenHex, "sessionToken"));
},