From 8ef832c7f1eac9bb54eb1e0b01783001015c6351 Mon Sep 17 00:00:00 2001 From: Fernando Jimenez Date: Tue, 8 Sep 2015 09:07:20 +0200 Subject: [PATCH] Bug 1202342 - Expose getAssertions to the System app. r=spenrose --- b2g/components/FxAccountsMgmtService.jsm | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/b2g/components/FxAccountsMgmtService.jsm b/b2g/components/FxAccountsMgmtService.jsm index 427dbcdf09b..1a46783ec9a 100644 --- a/b2g/components/FxAccountsMgmtService.jsm +++ b/b2g/components/FxAccountsMgmtService.jsm @@ -93,12 +93,23 @@ this.FxAccountsMgmtService = { delete data.accountId; } - // XXX dirty hack because Gaia is sending getAccounts. + // Bug 1202450 dirty hack because Gaia is sending getAccounts. if (data.method == "getAccounts") { data.method = "getAccount"; } switch(data.method) { + case "getAssertion": + let principal = Services.scriptSecurityManager.getSystemPrincipal(); + let audience = msg.audience || principal.originNoSuffix; + FxAccountsManager.getAssertion(audience, principal, { + silent: msg.silent || false + }).then(result => { + self._onFulfill(msg.id, result); + }, reason => { + self._onReject(msg.id, reason); + }); + break; case "getAccount": case "getKeys": FxAccountsManager[data.method]().then(