@getpara/core-sdk 3.2.0 → 3.3.0
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/cjs/ParaCore.js +1 -0
- package/dist/cjs/constants.js +1 -1
- package/dist/cjs/services/AuthService.js +3 -1
- package/dist/cjs/services/SessionManagementService.js +14 -0
- package/dist/esm/ParaCore.js +1 -0
- package/dist/esm/constants.js +1 -1
- package/dist/esm/services/AuthService.js +3 -1
- package/dist/esm/services/SessionManagementService.js +14 -0
- package/dist/types/services/SessionManagementService.d.ts +1 -0
- package/package.json +3 -3
package/dist/cjs/ParaCore.js
CHANGED
|
@@ -3489,6 +3489,7 @@ logout_fn = function() {
|
|
|
3489
3489
|
this.accountLinkInProgress = void 0;
|
|
3490
3490
|
__privateGet(this, _authService).userId = void 0;
|
|
3491
3491
|
__privateGet(this, _sessionManagementService).sessionCookie = void 0;
|
|
3492
|
+
__privateGet(this, _sessionManagementService).invalidateTouchSessionCache();
|
|
3492
3493
|
this.isEnclaveUser = false;
|
|
3493
3494
|
(0, import_uxStateSpanProcessor.setCurrentUserId)(void 0);
|
|
3494
3495
|
if (isSessionActive) {
|
package/dist/cjs/constants.js
CHANGED
|
@@ -46,7 +46,7 @@ __export(constants_exports, {
|
|
|
46
46
|
TRANSACTION_REVIEW_TIMEOUT_MS: () => TRANSACTION_REVIEW_TIMEOUT_MS
|
|
47
47
|
});
|
|
48
48
|
module.exports = __toCommonJS(constants_exports);
|
|
49
|
-
const PARA_CORE_VERSION = "3.
|
|
49
|
+
const PARA_CORE_VERSION = "3.3.0";
|
|
50
50
|
const PREFIX = "@CAPSULE/";
|
|
51
51
|
const PARA_PREFIX = "@PARA/";
|
|
52
52
|
const LOCAL_STORAGE_AUTH_INFO = `${PREFIX}authInfo`;
|
|
@@ -686,6 +686,7 @@ class AuthService {
|
|
|
686
686
|
}
|
|
687
687
|
}
|
|
688
688
|
const { sessionId } = yield __privateGet(this, _sessionManagementService).touchSession();
|
|
689
|
+
const hasExistingPasskey = userAuthMethods.has(import_user_management_client.AuthMethod.PASSKEY);
|
|
689
690
|
const result = (isForNewDevice || urlType) && (yield __privateGet(this, _portalUrlService).constructPortalUrl(isForNewDevice ? "addNewCredential" : urlType, {
|
|
690
691
|
isForNewDevice,
|
|
691
692
|
pathId: credentialId,
|
|
@@ -694,7 +695,8 @@ class AuthService {
|
|
|
694
695
|
sessionId: isForNewDevice ? sessionId : void 0,
|
|
695
696
|
addNewCredentialType: optsAuthMethod,
|
|
696
697
|
addNewCredentialPasskeyId: passkeyId,
|
|
697
|
-
addNewCredentialPasswordId: passwordId
|
|
698
|
+
addNewCredentialPasswordId: passwordId,
|
|
699
|
+
useLegacyUrl: hasExistingPasskey
|
|
698
700
|
}));
|
|
699
701
|
return __spreadValues({ credentialId }, result ? { url: result.url, fullUrl: result.fullUrl } : {});
|
|
700
702
|
});
|
|
@@ -218,6 +218,20 @@ const _SessionManagementService = class _SessionManagementService {
|
|
|
218
218
|
}
|
|
219
219
|
return session;
|
|
220
220
|
}));
|
|
221
|
+
// Drop the dedupe cache so the next touchSession() round-trips to the server
|
|
222
|
+
// instead of replaying the pre-logout snapshot. Without this, the core state
|
|
223
|
+
// machine's post-logout `checkUserState` (auth machine) hits the cache within
|
|
224
|
+
// the 1s TTL, sees `isAuthenticated: true` and `currentWalletIds` from before
|
|
225
|
+
// logout, re-applies the wallet IDs via #doTouchSession line 235-237, and
|
|
226
|
+
// reports `isFullyLoggedIn=true` — sending the state machine back to
|
|
227
|
+
// `authenticated` instead of `unauthenticated`. Called from ParaCore.#logout
|
|
228
|
+
// after the session cookie + in-memory auth state are cleared, so the next
|
|
229
|
+
// touchSession sees a fresh "no session" response.
|
|
230
|
+
this.invalidateTouchSessionCache = () => {
|
|
231
|
+
__privateSet(this, _touchCached, void 0);
|
|
232
|
+
__privateSet(this, _touchCachedAt, void 0);
|
|
233
|
+
__privateSet(this, _touchPromise, void 0);
|
|
234
|
+
};
|
|
221
235
|
this.isSessionActive = () => __async(this, null, function* () {
|
|
222
236
|
if (__privateGet(this, _externalWalletService).externalWalletConnectionType === "CONNECTION_ONLY") {
|
|
223
237
|
return true;
|
package/dist/esm/ParaCore.js
CHANGED
|
@@ -3434,6 +3434,7 @@ logout_fn = function() {
|
|
|
3434
3434
|
this.accountLinkInProgress = void 0;
|
|
3435
3435
|
__privateGet(this, _authService).userId = void 0;
|
|
3436
3436
|
__privateGet(this, _sessionManagementService).sessionCookie = void 0;
|
|
3437
|
+
__privateGet(this, _sessionManagementService).invalidateTouchSessionCache();
|
|
3437
3438
|
this.isEnclaveUser = false;
|
|
3438
3439
|
setCurrentUserId(void 0);
|
|
3439
3440
|
if (isSessionActive) {
|
package/dist/esm/constants.js
CHANGED
|
@@ -617,6 +617,7 @@ class AuthService {
|
|
|
617
617
|
}
|
|
618
618
|
}
|
|
619
619
|
const { sessionId } = yield __privateGet(this, _sessionManagementService).touchSession();
|
|
620
|
+
const hasExistingPasskey = userAuthMethods.has(AuthMethod.PASSKEY);
|
|
620
621
|
const result = (isForNewDevice || urlType) && (yield __privateGet(this, _portalUrlService).constructPortalUrl(isForNewDevice ? "addNewCredential" : urlType, {
|
|
621
622
|
isForNewDevice,
|
|
622
623
|
pathId: credentialId,
|
|
@@ -625,7 +626,8 @@ class AuthService {
|
|
|
625
626
|
sessionId: isForNewDevice ? sessionId : void 0,
|
|
626
627
|
addNewCredentialType: optsAuthMethod,
|
|
627
628
|
addNewCredentialPasskeyId: passkeyId,
|
|
628
|
-
addNewCredentialPasswordId: passwordId
|
|
629
|
+
addNewCredentialPasswordId: passwordId,
|
|
630
|
+
useLegacyUrl: hasExistingPasskey
|
|
629
631
|
}));
|
|
630
632
|
return __spreadValues({ credentialId }, result ? { url: result.url, fullUrl: result.fullUrl } : {});
|
|
631
633
|
});
|
|
@@ -162,6 +162,20 @@ const _SessionManagementService = class _SessionManagementService {
|
|
|
162
162
|
}
|
|
163
163
|
return session;
|
|
164
164
|
}));
|
|
165
|
+
// Drop the dedupe cache so the next touchSession() round-trips to the server
|
|
166
|
+
// instead of replaying the pre-logout snapshot. Without this, the core state
|
|
167
|
+
// machine's post-logout `checkUserState` (auth machine) hits the cache within
|
|
168
|
+
// the 1s TTL, sees `isAuthenticated: true` and `currentWalletIds` from before
|
|
169
|
+
// logout, re-applies the wallet IDs via #doTouchSession line 235-237, and
|
|
170
|
+
// reports `isFullyLoggedIn=true` — sending the state machine back to
|
|
171
|
+
// `authenticated` instead of `unauthenticated`. Called from ParaCore.#logout
|
|
172
|
+
// after the session cookie + in-memory auth state are cleared, so the next
|
|
173
|
+
// touchSession sees a fresh "no session" response.
|
|
174
|
+
this.invalidateTouchSessionCache = () => {
|
|
175
|
+
__privateSet(this, _touchCached, void 0);
|
|
176
|
+
__privateSet(this, _touchCachedAt, void 0);
|
|
177
|
+
__privateSet(this, _touchPromise, void 0);
|
|
178
|
+
};
|
|
165
179
|
this.isSessionActive = () => __async(this, null, function* () {
|
|
166
180
|
if (__privateGet(this, _externalWalletService).externalWalletConnectionType === "CONNECTION_ONLY") {
|
|
167
181
|
return true;
|
|
@@ -19,6 +19,7 @@ export declare class SessionManagementService {
|
|
|
19
19
|
pregenWalletService: PregenWalletService;
|
|
20
20
|
}) => void;
|
|
21
21
|
touchSession: TouchSessionMethod;
|
|
22
|
+
invalidateTouchSessionCache: () => void;
|
|
22
23
|
isSessionActive: IsSessionActiveMethod;
|
|
23
24
|
isFullyLoggedIn: IsFullyLoggedInMethod;
|
|
24
25
|
refreshSession: RefreshSessionMethod;
|
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@getpara/core-sdk",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.3.0",
|
|
4
4
|
"dependencies": {
|
|
5
5
|
"@celo/utils": "^8.0.2",
|
|
6
6
|
"@cosmjs/encoding": "^0.32.4",
|
|
7
7
|
"@ethereumjs/util": "^9.1.0",
|
|
8
|
-
"@getpara/user-management-client": "3.
|
|
8
|
+
"@getpara/user-management-client": "3.3.0",
|
|
9
9
|
"@noble/hashes": "^1.5.0",
|
|
10
10
|
"@opentelemetry/api": "^1.9.1",
|
|
11
11
|
"@opentelemetry/context-zone": "^2.7.1",
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
"dist",
|
|
42
42
|
"package.json"
|
|
43
43
|
],
|
|
44
|
-
"gitHead": "
|
|
44
|
+
"gitHead": "d9b54921d4187e2dd25f314b62ed99988e9b5b1c",
|
|
45
45
|
"main": "dist/cjs/index.js",
|
|
46
46
|
"module": "dist/esm/index.js",
|
|
47
47
|
"scripts": {
|