@aakash58/chatbot 1.1.9 → 1.1.10
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.
|
@@ -567,26 +567,32 @@ class AuthService {
|
|
|
567
567
|
* Resolves a federated token from browser storage
|
|
568
568
|
*/
|
|
569
569
|
resolveSilentToken() {
|
|
570
|
-
const commonKeys = ['access_token', 'id_token', 'token', 'authToken'];
|
|
571
570
|
const configuredKey = this.config?.autoConfigFromStorage;
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
571
|
+
// Try ABP official authentication API first
|
|
572
|
+
if (window.abp?.auth?.getToken) {
|
|
573
|
+
try {
|
|
574
|
+
const abpToken = window.abp.auth.getToken();
|
|
575
|
+
if (abpToken) {
|
|
576
|
+
Logger.info(`[Auth] Resolved token from ABP auth service: ${abpToken}`);
|
|
577
|
+
return abpToken;
|
|
578
|
+
}
|
|
579
|
+
Logger.debug('[Auth] ABP auth service returned no token');
|
|
580
|
+
}
|
|
581
|
+
catch (e) {
|
|
582
|
+
Logger.error('[Auth] Error calling abp.auth.getToken():', e);
|
|
579
583
|
}
|
|
580
584
|
}
|
|
581
|
-
//
|
|
582
|
-
|
|
583
|
-
const token = localStorage.getItem(
|
|
585
|
+
// Optional fallback: configured storage key
|
|
586
|
+
if (configuredKey) {
|
|
587
|
+
const token = localStorage.getItem(configuredKey) || sessionStorage.getItem(configuredKey);
|
|
584
588
|
if (token) {
|
|
585
|
-
Logger.
|
|
586
|
-
Logger.info(`[Auth] Resolved token from fallback key: ${token}`);
|
|
589
|
+
Logger.info(`[Auth] Resolved token from configured key: ${configuredKey}`);
|
|
587
590
|
return token;
|
|
588
591
|
}
|
|
592
|
+
Logger.debug(`[Auth] No token found at configured key: ${configuredKey}`);
|
|
589
593
|
}
|
|
594
|
+
// No token found
|
|
595
|
+
Logger.debug('[Auth] No token could be resolved from ABP or configured storage');
|
|
590
596
|
return null;
|
|
591
597
|
}
|
|
592
598
|
/**
|