@truly-you/trulyyou-web-sdk 0.1.15 → 0.1.17

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@truly-you/trulyyou-web-sdk",
3
- "version": "0.1.15",
3
+ "version": "0.1.17",
4
4
  "description": "TrulyYou Web SDK for secure authentication and payload signing",
5
5
  "type": "module",
6
6
  "main": "dist/index.esm.js",
@@ -301,10 +301,6 @@ export class TrulyYouSDK {
301
301
  }
302
302
 
303
303
  iframe.src = probeUrl.toString()
304
-
305
- console.log('[SDK-PROBE]: Creating probe iframe with URL:', probeUrl.toString())
306
- console.log('[SDK-PROBE]: Current origin:', origin)
307
- console.log('[SDK-PROBE]: Frontend URL:', this.frontendUrl)
308
304
 
309
305
  let timeout: NodeJS.Timeout | undefined
310
306
  let backendCheckPromise: Promise<boolean> | null = null
@@ -322,42 +318,27 @@ export class TrulyYouSDK {
322
318
  const handleMessage = async (event: MessageEvent) => {
323
319
  const data = event.data as any
324
320
 
325
- // Log ALL messages during probe to debug
326
- console.log('[SDK-PROBE-DEBUG]: Message received - type:', data?.type, 'origin:', event.origin, 'data:', data)
327
-
328
321
  // Only process probe-related messages
329
322
  if (data?.type === 'KEY_CHECK_RESULT' || data?.type === 'KEY_CHECK_FAILED') {
330
- console.log('[SDK-PROBE]: Processing probe message:', event.data, 'from origin:', event.origin)
331
-
332
323
  try {
333
324
  const frontendOrigin = new URL(this.frontendUrl).origin
334
- console.log('[SDK-PROBE]: Checking origin - expected:', frontendOrigin, 'received:', event.origin)
335
325
  if (event.origin !== frontendOrigin) {
336
- console.log('[SDK-PROBE]: Origin mismatch, ignoring message')
337
326
  return
338
327
  }
339
-
340
328
  } catch (e) {
341
- console.log('[SDK-PROBE]: Origin check failed, using hostname fallback')
342
329
  if (!event.origin.includes(window.location.hostname)) {
343
- console.log('[SDK-PROBE]: Hostname not in origin, ignoring message')
344
330
  return
345
331
  }
346
332
  }
347
-
348
- console.log('[SDK-PROBE]: Message passed origin check, type:', data?.type)
349
333
 
350
334
  if (data?.type === 'KEY_CHECK_RESULT') {
351
- console.log('[SDK-PROBE]: KEY_CHECK_RESULT received - hasKey:', data.hasKey, 'keyId:', data.keyId)
352
335
  cleanup()
353
336
  if (data.hasKey && data.keyId) {
354
- // Key found in localStorage - it will be validated when used in /api/signatures/create
355
337
  resolve(data.keyId)
356
338
  } else {
357
339
  resolve(null)
358
340
  }
359
341
  } else if (data?.type === 'KEY_CHECK_FAILED') {
360
- console.log('[SDK-PROBE]: KEY_CHECK_FAILED received')
361
342
  cleanup()
362
343
  resolve(null)
363
344
  }
@@ -366,7 +347,6 @@ export class TrulyYouSDK {
366
347
 
367
348
  window.addEventListener('message', handleMessage)
368
349
  document.body.appendChild(iframe)
369
- console.log('[SDK-PROBE]: Iframe appended to body, waiting for response...')
370
350
 
371
351
  // Timeout to allow for React hydration on sign page
372
352
  timeout = setTimeout(() => {