diff options
author | Florian Dold <florian.dold@gmail.com> | 2018-01-18 02:50:18 +0100 |
---|---|---|
committer | Florian Dold <florian.dold@gmail.com> | 2018-01-18 02:50:18 +0100 |
commit | 2f68e9e50e83c55ca46e9d4d72956d6525d0fa8c (patch) | |
tree | bfe94c2e0af1f3777765d37b35eeb76ed4e221be /src/webex/wxBackend.ts | |
parent | 82d9c2a7cd2e343866997438d44aa5422190a028 (diff) | |
download | wallet-core-2f68e9e50e83c55ca46e9d4d72956d6525d0fa8c.tar.xz |
fix handling of resource_url
Diffstat (limited to 'src/webex/wxBackend.ts')
-rw-r--r-- | src/webex/wxBackend.ts | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/webex/wxBackend.ts b/src/webex/wxBackend.ts index 7bbba1759..a4f534af9 100644 --- a/src/webex/wxBackend.ts +++ b/src/webex/wxBackend.ts @@ -422,7 +422,7 @@ async function talerPay(fields: any, url: string, tabId: number): Promise<string if (fields.resource_url) { const p = await w.queryPaymentByFulfillmentUrl(fields.resource_url); console.log("query for resource url", fields.resource_url, "result", p); - if (p.found) { + if (p.found && (fields.session_id === undefined || fields.session_id === p.lastSessionId)) { return goToPayment(p); } } @@ -508,9 +508,9 @@ function handleHttpPayment(headerList: chrome.webRequest.HttpHeader[], url: stri // Fast path for existing payment if (fields.resource_url) { - const nextUrl = currentWallet.getNextUrlFromResourceUrl(fields.resource_url); - if (nextUrl) { - return { redirectUrl: nextUrl }; + const result = currentWallet.getNextUrlFromResourceUrl(fields.resource_url); + if (result && (fields.session_id === undefined || fields.session_id === result.lastSessionId)) { + return { redirectUrl: result.nextUrl }; } } // Fast path for new contract |