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