@passkeyme/auth 1.1.6 → 1.1.7

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
@@ -843,12 +843,12 @@
843
843
  // Configure logger with debug setting from config
844
844
  if (this.config.debug) {
845
845
  logger.enableDebug();
846
- console.log("[DEBUG] Logger debug mode enabled, testing logger...");
847
- console.log("[DEBUG] Logger config after enableDebug:", logger.getConfig());
846
+ logger.debug("[DEBUG] Logger debug mode enabled, testing logger...");
847
+ logger.debug("[DEBUG] Logger config after enableDebug:", logger.getConfig());
848
848
  logger.debug("Logger test message - if you see this, logger is working");
849
849
  }
850
850
  logger.debug("Initialized with config:", this.config);
851
- console.log("[DEBUG] Constructor completed, config.debug:", this.config.debug);
851
+ logger.debug("[DEBUG] Constructor completed, config.debug:", this.config.debug);
852
852
  }
853
853
  /**
854
854
  * Create default passkey SDK based on environment
@@ -1496,23 +1496,17 @@
1496
1496
  * 4. Fallback to hosted auth if all passkey attempts fail
1497
1497
  */
1498
1498
  async smartLogin(username, apiKey) {
1499
- console.log("[DEBUG] smartLogin called with:", {
1500
- username,
1501
- hasApiKey: !!apiKey,
1502
- });
1503
- logger.debug("smartLogin called with:", {
1499
+ logger.debug("[DEBUG] smartLogin called with:", {
1504
1500
  username,
1505
1501
  hasApiKey: !!apiKey,
1506
1502
  });
1507
1503
  // Use provided API key or fall back to config
1508
1504
  const effectiveApiKey = apiKey || this.getPasskeyApiKey();
1509
- console.log("[DEBUG] effectiveApiKey:", !!effectiveApiKey);
1505
+ logger.debug("[INFO] effectiveApiKey:", !!effectiveApiKey);
1510
1506
  // Check if passkeys are supported and we have an API key
1511
1507
  const isSupported = this.isPasskeySupported();
1512
- console.log("[DEBUG] Passkey support check:", isSupported);
1513
- logger.debug("Passkey support check:", isSupported);
1508
+ logger.debug("[DEBUG] Passkey support check:", isSupported);
1514
1509
  if (!isSupported || !effectiveApiKey) {
1515
- console.log("[DEBUG] Conditions not met, redirecting to hosted auth. isSupported:", isSupported, "hasApiKey:", !!effectiveApiKey);
1516
1510
  logger.debug("Conditions not met, redirecting to hosted auth. isSupported:", isSupported, "hasApiKey:", !!effectiveApiKey);
1517
1511
  this.redirectToLogin();
1518
1512
  return { method: "redirect" };
@@ -1522,13 +1516,13 @@
1522
1516
  let appConfig;
1523
1517
  try {
1524
1518
  appConfig = await this.getAppConfig();
1525
- console.log("App config loaded:", {
1519
+ logger.debug("App config loaded:", {
1526
1520
  discoverableCredentialsEnabled: appConfig.discoverableCredentialsEnabled,
1527
1521
  passkeyEnabled: appConfig.passkeyEnabled,
1528
1522
  });
1529
1523
  }
1530
1524
  catch (configError) {
1531
- console.log("[DEBUG] Failed to load app config, assuming passkeys enabled:", configError);
1525
+ logger.debug("[DEBUG] Failed to load app config, assuming passkeys enabled:", configError);
1532
1526
  // If we can't load config, assume passkeys are enabled and no discoverable credentials
1533
1527
  appConfig = {
1534
1528
  passkeyEnabled: true,
@@ -1537,7 +1531,7 @@
1537
1531
  }
1538
1532
  // If passkeys are disabled at the app level, fallback to hosted auth
1539
1533
  if (!appConfig.passkeyEnabled) {
1540
- console.log("Passkeys disabled for this app, falling back to hosted auth");
1534
+ logger.debug("Passkeys disabled for this app, falling back to hosted auth");
1541
1535
  this.redirectToLogin();
1542
1536
  return { method: "redirect" };
1543
1537
  }
@@ -1559,11 +1553,11 @@
1559
1553
  }
1560
1554
  // Try to get stored username for fallback
1561
1555
  const storageKey = `last_username_${this.config.appId}`;
1562
- console.log("Looking for stored username with key:", storageKey);
1556
+ logger.debug("Looking for stored username with key:", storageKey);
1563
1557
  const storedUsername = await this.storage.getItem(storageKey);
1564
- console.log("Found stored username:", storedUsername);
1558
+ logger.debug("Found stored username:", storedUsername);
1565
1559
  if (storedUsername) {
1566
- console.log("Using stored username for targeted authentication:", storedUsername);
1560
+ logger.debug("Using stored username for targeted authentication:", storedUsername);
1567
1561
  authUsername = storedUsername;
1568
1562
  }
1569
1563
  else {