taler-typescript-core

Wallet core logic and WebUIs for various components
Log | Files | Refs | Submodules | README | LICENSE

commit ee908dd7aee66f0756e8a393fc2e8945e20b0283
parent fa2e7aa1725fecc993ee563476a6d3baa9244ccc
Author: Sebastian <sebasjm@gmail.com>
Date:   Wed, 21 Aug 2024 19:17:35 -0300

fix kyc-spa URL

Diffstat:
Mpackages/taler-wallet-core/src/exchanges.ts | 3++-
Mpackages/taler-wallet-core/src/pay-peer-pull-credit.ts | 3++-
Mpackages/taler-wallet-core/src/pay-peer-push-credit.ts | 7+++----
Mpackages/taler-wallet-core/src/withdraw.ts | 6++++--
4 files changed, 11 insertions(+), 8 deletions(-)

diff --git a/packages/taler-wallet-core/src/exchanges.ts b/packages/taler-wallet-core/src/exchanges.ts @@ -457,8 +457,9 @@ async function makeExchangeListItem( exchangeEntryStatus: getExchangeEntryStatusFromRecord(r), walletKycStatus, walletKycReservePub: reserveRec?.reservePub, + // FIXME: this should not be constructed here, it should be an opaque URL from exchange response walletKycUrl: reserveRec?.kycAccessToken - ? new URL(`kyc-spa/${reserveRec.kycAccessToken}`, r.baseUrl).href + ? new URL(`kyc-spa/#/token/${reserveRec.kycAccessToken}`, r.baseUrl).href : undefined, walletKycAccessToken: reserveRec?.kycAccessToken, tosStatus: getExchangeTosStatusFromRecord(r), diff --git a/packages/taler-wallet-core/src/pay-peer-pull-credit.ts b/packages/taler-wallet-core/src/pay-peer-pull-credit.ts @@ -1219,8 +1219,9 @@ async function processPeerPullCreditBalanceKyc( rec.status = PeerPullPaymentCreditStatus.PendingBalanceKycRequired; delete rec.kycInfo; rec.kycAccessToken = ret.walletKycAccessToken; + // FIXME: #9109 this should not be constructed here, it should be an opaque URL from exchange response rec.kycUrl = new URL( - `kyc-spa/${ret.walletKycAccessToken}`, + `kyc-spa/#/token/${ret.walletKycAccessToken}`, exchangeBaseUrl, ).href; return TransitionResult.transition(rec); diff --git a/packages/taler-wallet-core/src/pay-peer-push-credit.ts b/packages/taler-wallet-core/src/pay-peer-push-credit.ts @@ -1236,9 +1236,7 @@ async function processPeerPushCreditBalanceKyc( if (!rec) { return TransitionResult.stay(); } - if ( - rec.status !== PeerPushCreditStatus.PendingBalanceKycRequired - ) { + if (rec.status !== PeerPushCreditStatus.PendingBalanceKycRequired) { return TransitionResult.stay(); } rec.status = PeerPushCreditStatus.PendingMerge; @@ -1259,8 +1257,9 @@ async function processPeerPushCreditBalanceKyc( rec.status = PeerPushCreditStatus.PendingBalanceKycRequired; delete rec.kycInfo; rec.kycAccessToken = ret.walletKycAccessToken; + // FIXME: #9109 this should not be constructed here, it should be an opaque URL from exchange response rec.kycUrl = new URL( - `kyc-spa/${ret.walletKycAccessToken}`, + `kyc-spa/#/token/${ret.walletKycAccessToken}`, exchangeBaseUrl, ).href; return TransitionResult.transition(rec); diff --git a/packages/taler-wallet-core/src/withdraw.ts b/packages/taler-wallet-core/src/withdraw.ts @@ -1029,8 +1029,9 @@ async function processWithdrawalGroupBalanceKyc( wg.status = WithdrawalGroupStatus.PendingBalanceKyc; wg.kycPending = undefined; wg.kycAccessToken = ret.walletKycAccessToken; + // FIXME: #9109 this should not be constructed here, it should be an opaque URL from exchange response wg.kycUrl = new URL( - `kyc-spa/${ret.walletKycAccessToken}`, + `kyc-spa/#/token/${ret.walletKycAccessToken}`, exchangeBaseUrl, ).href; return TransitionResult.transition(wg); @@ -1434,8 +1435,9 @@ async function handleKycRequired( paytoHash: uuidResp.h_payto, requirementRow: uuidResp.requirement_row, }; + // FIXME: #9109 this should not be constructed here, it should be an opaque URL from exchange response wg2.kycUrl = new URL( - `kyc-spa/${kycStatus.access_token}`, + `kyc-spa/#/token/${kycStatus.access_token}`, exchangeUrl, ).href; wg2.kycAccessToken = kycStatus.access_token;