@passkeyme/auth 1.1.5 → 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.js CHANGED
@@ -48,7 +48,7 @@ class Logger {
48
48
  }
49
49
  debug(message, ...args) {
50
50
  if (this.shouldLog("debug")) {
51
- console.debug(...this.formatMessage(message, ...args));
51
+ console.log(...this.formatMessage(message, ...args));
52
52
  }
53
53
  }
54
54
  info(message, ...args) {
@@ -841,12 +841,12 @@ class PasskeymeAuth {
841
841
  // Configure logger with debug setting from config
842
842
  if (this.config.debug) {
843
843
  logger.enableDebug();
844
- console.log("[DEBUG] Logger debug mode enabled, testing logger...");
845
- console.log("[DEBUG] Logger config after enableDebug:", logger.getConfig());
844
+ logger.debug("[DEBUG] Logger debug mode enabled, testing logger...");
845
+ logger.debug("[DEBUG] Logger config after enableDebug:", logger.getConfig());
846
846
  logger.debug("Logger test message - if you see this, logger is working");
847
847
  }
848
848
  logger.debug("Initialized with config:", this.config);
849
- console.log("[DEBUG] Constructor completed, config.debug:", this.config.debug);
849
+ logger.debug("[DEBUG] Constructor completed, config.debug:", this.config.debug);
850
850
  }
851
851
  /**
852
852
  * Create default passkey SDK based on environment
@@ -1494,23 +1494,17 @@ class PasskeymeAuth {
1494
1494
  * 4. Fallback to hosted auth if all passkey attempts fail
1495
1495
  */
1496
1496
  async smartLogin(username, apiKey) {
1497
- console.log("[DEBUG] smartLogin called with:", {
1498
- username,
1499
- hasApiKey: !!apiKey,
1500
- });
1501
- logger.debug("smartLogin called with:", {
1497
+ logger.debug("[DEBUG] smartLogin called with:", {
1502
1498
  username,
1503
1499
  hasApiKey: !!apiKey,
1504
1500
  });
1505
1501
  // Use provided API key or fall back to config
1506
1502
  const effectiveApiKey = apiKey || this.getPasskeyApiKey();
1507
- console.log("[DEBUG] effectiveApiKey:", !!effectiveApiKey);
1503
+ logger.debug("[INFO] effectiveApiKey:", !!effectiveApiKey);
1508
1504
  // Check if passkeys are supported and we have an API key
1509
1505
  const isSupported = this.isPasskeySupported();
1510
- console.log("[DEBUG] Passkey support check:", isSupported);
1511
- logger.debug("Passkey support check:", isSupported);
1506
+ logger.debug("[DEBUG] Passkey support check:", isSupported);
1512
1507
  if (!isSupported || !effectiveApiKey) {
1513
- console.log("[DEBUG] Conditions not met, redirecting to hosted auth. isSupported:", isSupported, "hasApiKey:", !!effectiveApiKey);
1514
1508
  logger.debug("Conditions not met, redirecting to hosted auth. isSupported:", isSupported, "hasApiKey:", !!effectiveApiKey);
1515
1509
  this.redirectToLogin();
1516
1510
  return { method: "redirect" };
@@ -1526,7 +1520,7 @@ class PasskeymeAuth {
1526
1520
  });
1527
1521
  }
1528
1522
  catch (configError) {
1529
- logger.debug("Failed to load app config, assuming passkeys enabled:", configError);
1523
+ logger.debug("[DEBUG] Failed to load app config, assuming passkeys enabled:", configError);
1530
1524
  // If we can't load config, assume passkeys are enabled and no discoverable credentials
1531
1525
  appConfig = {
1532
1526
  passkeyEnabled: true,
@@ -1557,11 +1551,11 @@ class PasskeymeAuth {
1557
1551
  }
1558
1552
  // Try to get stored username for fallback
1559
1553
  const storageKey = `last_username_${this.config.appId}`;
1560
- console.log("Looking for stored username with key:", storageKey);
1554
+ logger.debug("Looking for stored username with key:", storageKey);
1561
1555
  const storedUsername = await this.storage.getItem(storageKey);
1562
- console.log("Found stored username:", storedUsername);
1556
+ logger.debug("Found stored username:", storedUsername);
1563
1557
  if (storedUsername) {
1564
- console.log("Using stored username for targeted authentication:", storedUsername);
1558
+ logger.debug("Using stored username for targeted authentication:", storedUsername);
1565
1559
  authUsername = storedUsername;
1566
1560
  }
1567
1561
  else {