gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[taler-wallet-core] branch master updated: support accepted response


From: gnunet
Subject: [taler-wallet-core] branch master updated: support accepted response
Date: Fri, 01 Nov 2024 16:37:01 +0100

This is an automated email from the git hooks/post-receive script.

sebasjm pushed a commit to branch master
in repository wallet-core.

The following commit(s) were added to refs/heads/master by this push:
     new 983850595 support accepted response
983850595 is described below

commit 9838505956eb5e4b5067258311b8d4482ef1a5ff
Author: Sebastian <sebasjm@gmail.com>
AuthorDate: Fri Nov 1 12:36:36 2024 -0300

    support accepted response
---
 packages/kyc-ui/src/Routing.tsx                 | 22 +++++++++++++++-------
 packages/kyc-ui/src/pages/Start.tsx             |  3 +++
 packages/taler-util/src/http-client/exchange.ts | 12 +++++++-----
 3 files changed, 25 insertions(+), 12 deletions(-)

diff --git a/packages/kyc-ui/src/Routing.tsx b/packages/kyc-ui/src/Routing.tsx
index a5508e7da..846a16d2a 100644
--- a/packages/kyc-ui/src/Routing.tsx
+++ b/packages/kyc-ui/src/Routing.tsx
@@ -14,7 +14,7 @@
  GNU Taler; see the file COPYING.  If not, see <http://www.gnu.org/licenses/>
  */
 
-import {
+ import {
   Loading,
   urlPattern,
   useCurrentLocation,
@@ -64,18 +64,26 @@ export function safeToURL(s: string | undefined): URL | 
undefined {
 const ACCESS_TOKEN_REGEX = new RegExp("[A-Z0-9]{52}")
 
 /**
- * by how the exchange
- * /kyc-spa/KXAFXEWM7E3EJSYD9GJ30FYK1C17AKZWV119ZJA3XGPBBMZFJ2C0
- *
+ * by how the exchange serves the SPA
+ * /kyc-spa/KXAFXEWM7E3EJSYD9GJ30FYK1C17AKZWV119ZJA3XGPBBMZFJ2C0#/start
+ * 
+ * by how dev.mjs serves the SPA
+ * /app/?token=KXAFXEWM7E3EJSYD9GJ30FYK1C17AKZWV119ZJA3XGPBBMZFJ2C0#/start
  * @returns
  */
 function getAccessTokenFromURL(): AccessToken | undefined {
   if (typeof window === "undefined") return undefined;
   const paths = window.location.pathname.split("/");
   if (paths.length < 3) return undefined;
-  const res = paths[2] as AccessToken
-  if (!ACCESS_TOKEN_REGEX.test(res)) return undefined;
-  return res;
+  const path = paths[2]
+  if (path && ACCESS_TOKEN_REGEX.test(path)) {
+    return path as AccessToken;
+  }
+  const param = new URLSearchParams(window.location.search).get("token")
+  if (param && ACCESS_TOKEN_REGEX.test(param)) {
+    return param as AccessToken;
+  }
+  return undefined;
 }
 
 function PublicRounting(): VNode {
diff --git a/packages/kyc-ui/src/pages/Start.tsx 
b/packages/kyc-ui/src/pages/Start.tsx
index f84e3e77a..3dbecc093 100644
--- a/packages/kyc-ui/src/pages/Start.tsx
+++ b/packages/kyc-ui/src/pages/Start.tsx
@@ -67,6 +67,9 @@ function ShowReqList({
       case HttpStatusCode.NoContent: {
         return <div> not requirements </div>;
       }
+      case HttpStatusCode.Accepted: {
+        return <div> accepted </div>;
+      }
       default: {
         assertUnreachable(result);
       }
diff --git a/packages/taler-util/src/http-client/exchange.ts 
b/packages/taler-util/src/http-client/exchange.ts
index b56c1ca0a..b8dbdf0cf 100644
--- a/packages/taler-util/src/http-client/exchange.ts
+++ b/packages/taler-util/src/http-client/exchange.ts
@@ -58,11 +58,7 @@ import {
   codecForKycProcessStartInformation,
   codecForLegitimizationNeededResponse,
 } from "../types-taler-exchange.js";
-import {
-  CacheEvictor,
-  addPaginationParams,
-  nullEvictor,
-} from "./utils.js";
+import { CacheEvictor, addPaginationParams, nullEvictor } from "./utils.js";
 
 import { TalerError } from "../errors.js";
 import { TalerErrorCode } from "../taler-error-codes.js";
@@ -703,6 +699,12 @@ export class TalerExchangeHttpClient {
     switch (resp.status) {
       case HttpStatusCode.Ok:
         return opSuccessFromHttp(resp, codecForKycProcessClientInformation());
+      case HttpStatusCode.Accepted:
+        return opKnownAlternativeFailure(
+          resp,
+          HttpStatusCode.Accepted,
+          codecForEmptyObject(),
+        );
       case HttpStatusCode.NoContent:
         return opKnownAlternativeFailure(
           resp,

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]