@passkeyme/auth 1.1.3 → 1.1.5

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/dist/index.umd.js CHANGED
@@ -30,6 +30,12 @@
30
30
  this.config.enabled = true;
31
31
  this.config.level = "debug";
32
32
  }
33
+ /**
34
+ * Get current logger configuration (for debugging)
35
+ */
36
+ getConfig() {
37
+ return { ...this.config };
38
+ }
33
39
  shouldLog(level) {
34
40
  if (!this.config.enabled)
35
41
  return false;
@@ -837,8 +843,12 @@
837
843
  // Configure logger with debug setting from config
838
844
  if (this.config.debug) {
839
845
  logger.enableDebug();
846
+ console.log("[DEBUG] Logger debug mode enabled, testing logger...");
847
+ console.log("[DEBUG] Logger config after enableDebug:", logger.getConfig());
848
+ logger.debug("Logger test message - if you see this, logger is working");
840
849
  }
841
850
  logger.debug("Initialized with config:", this.config);
851
+ console.log("[DEBUG] Constructor completed, config.debug:", this.config.debug);
842
852
  }
843
853
  /**
844
854
  * Create default passkey SDK based on environment
@@ -1486,16 +1496,23 @@
1486
1496
  * 4. Fallback to hosted auth if all passkey attempts fail
1487
1497
  */
1488
1498
  async smartLogin(username, apiKey) {
1499
+ console.log("[DEBUG] smartLogin called with:", {
1500
+ username,
1501
+ hasApiKey: !!apiKey,
1502
+ });
1489
1503
  logger.debug("smartLogin called with:", {
1490
1504
  username,
1491
1505
  hasApiKey: !!apiKey,
1492
1506
  });
1493
1507
  // Use provided API key or fall back to config
1494
1508
  const effectiveApiKey = apiKey || this.getPasskeyApiKey();
1509
+ console.log("[DEBUG] effectiveApiKey:", !!effectiveApiKey);
1495
1510
  // Check if passkeys are supported and we have an API key
1496
1511
  const isSupported = this.isPasskeySupported();
1512
+ console.log("[DEBUG] Passkey support check:", isSupported);
1497
1513
  logger.debug("Passkey support check:", isSupported);
1498
1514
  if (!isSupported || !effectiveApiKey) {
1515
+ console.log("[DEBUG] Conditions not met, redirecting to hosted auth. isSupported:", isSupported, "hasApiKey:", !!effectiveApiKey);
1499
1516
  logger.debug("Conditions not met, redirecting to hosted auth. isSupported:", isSupported, "hasApiKey:", !!effectiveApiKey);
1500
1517
  this.redirectToLogin();
1501
1518
  return { method: "redirect" };
@@ -1542,11 +1559,11 @@
1542
1559
  }
1543
1560
  // Try to get stored username for fallback
1544
1561
  const storageKey = `last_username_${this.config.appId}`;
1545
- logger.debug("Looking for stored username with key:", storageKey);
1562
+ console.log("Looking for stored username with key:", storageKey);
1546
1563
  const storedUsername = await this.storage.getItem(storageKey);
1547
- logger.debug("Found stored username:", storedUsername);
1564
+ console.log("Found stored username:", storedUsername);
1548
1565
  if (storedUsername) {
1549
- logger.debug("Using stored username for targeted authentication:", storedUsername);
1566
+ console.log("Using stored username for targeted authentication:", storedUsername);
1550
1567
  authUsername = storedUsername;
1551
1568
  }
1552
1569
  else {
@@ -1634,6 +1651,7 @@
1634
1651
  return this._appConfigPromise;
1635
1652
  }
1636
1653
  }
1654
+ // Test comment
1637
1655
 
1638
1656
  /**
1639
1657
  * HTTP interceptors for automatic token management