@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.esm.js +21 -3
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +21 -3
- package/dist/index.js.map +1 -1
- package/dist/index.umd.js +21 -3
- package/dist/index.umd.js.map +1 -1
- package/dist/src/passkeyme-auth.d.ts.map +1 -1
- package/dist/src/utils/logger.d.ts +4 -0
- package/dist/src/utils/logger.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/index.esm.js
CHANGED
|
@@ -24,6 +24,12 @@ class Logger {
|
|
|
24
24
|
this.config.enabled = true;
|
|
25
25
|
this.config.level = "debug";
|
|
26
26
|
}
|
|
27
|
+
/**
|
|
28
|
+
* Get current logger configuration (for debugging)
|
|
29
|
+
*/
|
|
30
|
+
getConfig() {
|
|
31
|
+
return { ...this.config };
|
|
32
|
+
}
|
|
27
33
|
shouldLog(level) {
|
|
28
34
|
if (!this.config.enabled)
|
|
29
35
|
return false;
|
|
@@ -831,8 +837,12 @@ class PasskeymeAuth {
|
|
|
831
837
|
// Configure logger with debug setting from config
|
|
832
838
|
if (this.config.debug) {
|
|
833
839
|
logger.enableDebug();
|
|
840
|
+
console.log("[DEBUG] Logger debug mode enabled, testing logger...");
|
|
841
|
+
console.log("[DEBUG] Logger config after enableDebug:", logger.getConfig());
|
|
842
|
+
logger.debug("Logger test message - if you see this, logger is working");
|
|
834
843
|
}
|
|
835
844
|
logger.debug("Initialized with config:", this.config);
|
|
845
|
+
console.log("[DEBUG] Constructor completed, config.debug:", this.config.debug);
|
|
836
846
|
}
|
|
837
847
|
/**
|
|
838
848
|
* Create default passkey SDK based on environment
|
|
@@ -1480,16 +1490,23 @@ class PasskeymeAuth {
|
|
|
1480
1490
|
* 4. Fallback to hosted auth if all passkey attempts fail
|
|
1481
1491
|
*/
|
|
1482
1492
|
async smartLogin(username, apiKey) {
|
|
1493
|
+
console.log("[DEBUG] smartLogin called with:", {
|
|
1494
|
+
username,
|
|
1495
|
+
hasApiKey: !!apiKey,
|
|
1496
|
+
});
|
|
1483
1497
|
logger.debug("smartLogin called with:", {
|
|
1484
1498
|
username,
|
|
1485
1499
|
hasApiKey: !!apiKey,
|
|
1486
1500
|
});
|
|
1487
1501
|
// Use provided API key or fall back to config
|
|
1488
1502
|
const effectiveApiKey = apiKey || this.getPasskeyApiKey();
|
|
1503
|
+
console.log("[DEBUG] effectiveApiKey:", !!effectiveApiKey);
|
|
1489
1504
|
// Check if passkeys are supported and we have an API key
|
|
1490
1505
|
const isSupported = this.isPasskeySupported();
|
|
1506
|
+
console.log("[DEBUG] Passkey support check:", isSupported);
|
|
1491
1507
|
logger.debug("Passkey support check:", isSupported);
|
|
1492
1508
|
if (!isSupported || !effectiveApiKey) {
|
|
1509
|
+
console.log("[DEBUG] Conditions not met, redirecting to hosted auth. isSupported:", isSupported, "hasApiKey:", !!effectiveApiKey);
|
|
1493
1510
|
logger.debug("Conditions not met, redirecting to hosted auth. isSupported:", isSupported, "hasApiKey:", !!effectiveApiKey);
|
|
1494
1511
|
this.redirectToLogin();
|
|
1495
1512
|
return { method: "redirect" };
|
|
@@ -1536,11 +1553,11 @@ class PasskeymeAuth {
|
|
|
1536
1553
|
}
|
|
1537
1554
|
// Try to get stored username for fallback
|
|
1538
1555
|
const storageKey = `last_username_${this.config.appId}`;
|
|
1539
|
-
|
|
1556
|
+
console.log("Looking for stored username with key:", storageKey);
|
|
1540
1557
|
const storedUsername = await this.storage.getItem(storageKey);
|
|
1541
|
-
|
|
1558
|
+
console.log("Found stored username:", storedUsername);
|
|
1542
1559
|
if (storedUsername) {
|
|
1543
|
-
|
|
1560
|
+
console.log("Using stored username for targeted authentication:", storedUsername);
|
|
1544
1561
|
authUsername = storedUsername;
|
|
1545
1562
|
}
|
|
1546
1563
|
else {
|
|
@@ -1628,6 +1645,7 @@ class PasskeymeAuth {
|
|
|
1628
1645
|
return this._appConfigPromise;
|
|
1629
1646
|
}
|
|
1630
1647
|
}
|
|
1648
|
+
// Test comment
|
|
1631
1649
|
|
|
1632
1650
|
/**
|
|
1633
1651
|
* HTTP interceptors for automatic token management
|