Преглед на файлове

add the last tshield part

gdias преди 3 седмици
родител
ревизия
dcbc59e7bd
променени са 2 файла, в които са добавени 13 реда и са изтрити 6 реда
  1. 3 6
      src/routes/+page.svelte
  2. 10 0
      src/routes/register/+page.svelte

+ 3 - 6
src/routes/+page.svelte

@@ -199,11 +199,7 @@
           console.error('Resposta inválida do endpoint de status do KYC:', err);
           console.error('Resposta inválida do endpoint de status do KYC:', err);
         }
         }
       }
       }
-      console.log('[login] status KYC retornado pelo backend', {
-        status: res.status,
-        body,
-        raw
-      });
+      console.log('[login] status KYC retornado pelo backend', body ?? raw ?? null);
       if (!res.ok) {
       if (!res.ok) {
         const message = body?.message ?? body?.msg ?? 'Falha ao consultar status do KYC.';
         const message = body?.message ?? body?.msg ?? 'Falha ao consultar status do KYC.';
         throw new Error(message);
         throw new Error(message);
@@ -213,10 +209,11 @@
       if (!Number.isNaN(resolvedStatus)) {
       if (!Number.isNaN(resolvedStatus)) {
         kycStatusCode = resolvedStatus;
         kycStatusCode = resolvedStatus;
         if (resolvedStatus === 1) {
         if (resolvedStatus === 1) {
-          kycStatusMessage = 'KYC concluído com sucesso. Faça login novamente.';
+          kycStatusMessage = 'KYC validado com sucesso.';
           kycError = '';
           kycError = '';
           clearPendingState();
           clearPendingState();
           stopKycPolling();
           stopKycPolling();
+          handleBackToLogin('KYC validado com sucesso. Faça login novamente.');
         } else if (resolvedStatus === 2) {
         } else if (resolvedStatus === 2) {
           kycStatusMessage = 'Falha na validação do KYC. Entre em contato com o suporte.';
           kycStatusMessage = 'Falha na validação do KYC. Entre em contato com o suporte.';
           clearPendingState();
           clearPendingState();

+ 10 - 0
src/routes/register/+page.svelte

@@ -156,6 +156,11 @@
           console.error('Resposta inválida do endpoint de status do KYC:', err);
           console.error('Resposta inválida do endpoint de status do KYC:', err);
         }
         }
       }
       }
+      console.log('[register] status KYC retornado pelo backend', {
+        status: res.status,
+        body,
+        raw
+      });
       if (!res.ok) {
       if (!res.ok) {
         const message = body?.message ?? body?.msg ?? 'Falha ao consultar status do KYC.';
         const message = body?.message ?? body?.msg ?? 'Falha ao consultar status do KYC.';
         throw new Error(message);
         throw new Error(message);
@@ -261,6 +266,11 @@
           console.error('Resposta inválida do endpoint /company/user/create:', parseErr);
           console.error('Resposta inválida do endpoint /company/user/create:', parseErr);
         }
         }
       }
       }
+      console.log('[register] resposta do backend /company/user/create', {
+        status: res.status,
+        body,
+        raw
+      });
 
 
       if (!res.ok) {
       if (!res.ok) {
         const msg =
         const msg =