@passkeyme/auth 1.1.4 → 1.1.6
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 +15 -7
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +15 -7
- package/dist/index.js.map +1 -1
- package/dist/index.umd.js +15 -7
- 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;
|
|
@@ -42,7 +48,7 @@ class Logger {
|
|
|
42
48
|
}
|
|
43
49
|
debug(message, ...args) {
|
|
44
50
|
if (this.shouldLog("debug")) {
|
|
45
|
-
console.
|
|
51
|
+
console.log(...this.formatMessage(message, ...args));
|
|
46
52
|
}
|
|
47
53
|
}
|
|
48
54
|
info(message, ...args) {
|
|
@@ -836,6 +842,7 @@ class PasskeymeAuth {
|
|
|
836
842
|
if (this.config.debug) {
|
|
837
843
|
logger.enableDebug();
|
|
838
844
|
console.log("[DEBUG] Logger debug mode enabled, testing logger...");
|
|
845
|
+
console.log("[DEBUG] Logger config after enableDebug:", logger.getConfig());
|
|
839
846
|
logger.debug("Logger test message - if you see this, logger is working");
|
|
840
847
|
}
|
|
841
848
|
logger.debug("Initialized with config:", this.config);
|
|
@@ -1513,13 +1520,13 @@ class PasskeymeAuth {
|
|
|
1513
1520
|
let appConfig;
|
|
1514
1521
|
try {
|
|
1515
1522
|
appConfig = await this.getAppConfig();
|
|
1516
|
-
|
|
1523
|
+
console.log("App config loaded:", {
|
|
1517
1524
|
discoverableCredentialsEnabled: appConfig.discoverableCredentialsEnabled,
|
|
1518
1525
|
passkeyEnabled: appConfig.passkeyEnabled,
|
|
1519
1526
|
});
|
|
1520
1527
|
}
|
|
1521
1528
|
catch (configError) {
|
|
1522
|
-
|
|
1529
|
+
console.log("[DEBUG] Failed to load app config, assuming passkeys enabled:", configError);
|
|
1523
1530
|
// If we can't load config, assume passkeys are enabled and no discoverable credentials
|
|
1524
1531
|
appConfig = {
|
|
1525
1532
|
passkeyEnabled: true,
|
|
@@ -1528,7 +1535,7 @@ class PasskeymeAuth {
|
|
|
1528
1535
|
}
|
|
1529
1536
|
// If passkeys are disabled at the app level, fallback to hosted auth
|
|
1530
1537
|
if (!appConfig.passkeyEnabled) {
|
|
1531
|
-
|
|
1538
|
+
console.log("Passkeys disabled for this app, falling back to hosted auth");
|
|
1532
1539
|
this.redirectToLogin();
|
|
1533
1540
|
return { method: "redirect" };
|
|
1534
1541
|
}
|
|
@@ -1550,11 +1557,11 @@ class PasskeymeAuth {
|
|
|
1550
1557
|
}
|
|
1551
1558
|
// Try to get stored username for fallback
|
|
1552
1559
|
const storageKey = `last_username_${this.config.appId}`;
|
|
1553
|
-
|
|
1560
|
+
console.log("Looking for stored username with key:", storageKey);
|
|
1554
1561
|
const storedUsername = await this.storage.getItem(storageKey);
|
|
1555
|
-
|
|
1562
|
+
console.log("Found stored username:", storedUsername);
|
|
1556
1563
|
if (storedUsername) {
|
|
1557
|
-
|
|
1564
|
+
console.log("Using stored username for targeted authentication:", storedUsername);
|
|
1558
1565
|
authUsername = storedUsername;
|
|
1559
1566
|
}
|
|
1560
1567
|
else {
|
|
@@ -1642,6 +1649,7 @@ class PasskeymeAuth {
|
|
|
1642
1649
|
return this._appConfigPromise;
|
|
1643
1650
|
}
|
|
1644
1651
|
}
|
|
1652
|
+
// Test comment
|
|
1645
1653
|
|
|
1646
1654
|
/**
|
|
1647
1655
|
* HTTP interceptors for automatic token management
|