From a61be4337eaae40dca7de0452a25d3819048a466 Mon Sep 17 00:00:00 2001 From: nataschaberg Date: Mon, 18 Feb 2019 10:11:47 +0100 Subject: [PATCH 1/2] validation commented out --- src/actions/sso/index.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/actions/sso/index.ts b/src/actions/sso/index.ts index 624421e489..0772157b45 100644 --- a/src/actions/sso/index.ts +++ b/src/actions/sso/index.ts @@ -126,11 +126,11 @@ interface AttributeSummary { export const consumeCredentialRequest = (decodedCredentialRequest: JSONWebToken) => { return async (dispatch: Dispatch, getState: Function, backendMiddleware: BackendMiddleware) => { - const { storageLib, identityWallet } = backendMiddleware + const { storageLib } = backendMiddleware const { did } = getState().account.did.toJS() try { - await identityWallet.validateJWT(decodedCredentialRequest) + // await identityWallet.validateJWT(decodedCredentialRequest) const requestedTypes = decodedCredentialRequest.interactionToken.requestedCredentialTypes const attributesForType = await Promise.all(requestedTypes.map(storageLib.get.attributesByType)) From ac7e6d3cf749d79ff20cf8fad983ce28bbd2e74f Mon Sep 17 00:00:00 2001 From: nataschaberg Date: Mon, 18 Feb 2019 10:24:20 +0100 Subject: [PATCH 2/2] deep link route on cancel - payment only --- src/actions/payment/index.ts | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/src/actions/payment/index.ts b/src/actions/payment/index.ts index c6076d3cb7..acfc5adbe5 100644 --- a/src/actions/payment/index.ts +++ b/src/actions/payment/index.ts @@ -26,9 +26,20 @@ export const clearPaymentRequest = () => { } export const cancelPaymentRequest = () => { - return (dispatch: Dispatch) => { + return (dispatch: Dispatch, getState: Function) => { + const { callbackURL } = getState().payment.activePaymentRequest dispatch(clearPaymentRequest()) - dispatch(navigationActions.navigatorReset({ routeName: routeList.Home })) + + /** + * This needs to be cleaned up after demo + * TODO: consolidate routing back to callbackURL for deep linking for payment & sso + */ + if (callbackURL.includes('http')) { + dispatch(navigationActions.navigatorReset({ routeName: routeList.Home })) + } else { + const url = callbackURL + Buffer.from(JSON.stringify({token: false})).toString('base64') + Linking.openURL(url) + } } }