@dynamic-labs-sdk/client 0.1.0-alpha.27 → 0.1.0-alpha.28

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/CHANGELOG.md CHANGED
@@ -1,3 +1,9 @@
1
+ ## 0.1.0-alpha.28 (2025-11-03)
2
+
3
+ ### 🩹 Fixes
4
+
5
+ - don't override mfa token on non-mfa related state updates ([#630](https://github.com/dynamic-labs/dynamic-sdk/pull/630))
6
+
1
7
  ## 0.1.0-alpha.27 (2025-11-03)
2
8
 
3
9
  This was a version bump only, there were no code changes.
package/constants.cjs.js CHANGED
@@ -4,7 +4,7 @@ var sdkApiCore = require('@dynamic-labs/sdk-api-core');
4
4
  var buffer = require('buffer');
5
5
 
6
6
  var name = "@dynamic-labs-sdk/client";
7
- var version = "0.1.0-alpha.27";
7
+ var version = "0.1.0-alpha.28";
8
8
  var dependencies = {
9
9
  "@dynamic-labs/sdk-api-core": "0.0.818"};
10
10
 
package/constants.esm.js CHANGED
@@ -2,7 +2,7 @@ import { AuthStorageEnum, SDKApi, Configuration } from '@dynamic-labs/sdk-api-co
2
2
  import { Buffer as Buffer$1 } from 'buffer';
3
3
 
4
4
  var name = "@dynamic-labs-sdk/client";
5
- var version = "0.1.0-alpha.27";
5
+ var version = "0.1.0-alpha.28";
6
6
  var dependencies = {
7
7
  "@dynamic-labs/sdk-api-core": "0.0.818"};
8
8
 
@@ -443,13 +443,17 @@ const updateAuthFromVerifyResponse = ({ response }, client)=>{
443
443
  const { user, minifiedJwt, jwt, expiresAt, mfaToken } = response;
444
444
  // Expires at is in seconds, so we need to convert it to milliseconds
445
445
  const sessionExpiresAt = new Date(expiresAt * 1000);
446
- core.state.set({
446
+ const newState = {
447
447
  legacyToken: jwt != null ? jwt : null,
448
- mfaToken: mfaToken != null ? mfaToken : null,
449
448
  sessionExpiresAt: sessionExpiresAt,
450
449
  token: minifiedJwt != null ? minifiedJwt : null,
451
450
  user
452
- });
451
+ };
452
+ // only override the mfaToken if a new one is provided in the response
453
+ if (mfaToken) {
454
+ newState.mfaToken = mfaToken;
455
+ }
456
+ core.state.set(newState);
453
457
  /**
454
458
  * For customers using a sandbox environment with cookies enabled, we need to set the cookie
455
459
  * programmatically because Redcoast won't set the cookie via headers. We set the cookie programmatically
@@ -441,13 +441,17 @@ const updateAuthFromVerifyResponse = ({ response }, client)=>{
441
441
  const { user, minifiedJwt, jwt, expiresAt, mfaToken } = response;
442
442
  // Expires at is in seconds, so we need to convert it to milliseconds
443
443
  const sessionExpiresAt = new Date(expiresAt * 1000);
444
- core.state.set({
444
+ const newState = {
445
445
  legacyToken: jwt != null ? jwt : null,
446
- mfaToken: mfaToken != null ? mfaToken : null,
447
446
  sessionExpiresAt: sessionExpiresAt,
448
447
  token: minifiedJwt != null ? minifiedJwt : null,
449
448
  user
450
- });
449
+ };
450
+ // only override the mfaToken if a new one is provided in the response
451
+ if (mfaToken) {
452
+ newState.mfaToken = mfaToken;
453
+ }
454
+ core.state.set(newState);
451
455
  /**
452
456
  * For customers using a sandbox environment with cookies enabled, we need to set the cookie
453
457
  * programmatically because Redcoast won't set the cookie via headers. We set the cookie programmatically
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dynamic-labs-sdk/client",
3
- "version": "0.1.0-alpha.27",
3
+ "version": "0.1.0-alpha.28",
4
4
  "type": "module",
5
5
  "main": "./index.cjs.js",
6
6
  "module": "./index.esm.js",
@@ -29,7 +29,7 @@
29
29
  }
30
30
  },
31
31
  "dependencies": {
32
- "@dynamic-labs-sdk/assert-package-version": "0.1.0-alpha.27",
32
+ "@dynamic-labs-sdk/assert-package-version": "0.1.0-alpha.28",
33
33
  "@dynamic-labs/sdk-api-core": "0.0.818",
34
34
  "@dynamic-labs-wallet/browser-wallet-client": "0.0.187",
35
35
  "@simplewebauthn/browser": "13.1.0",
@@ -1 +1 @@
1
- {"version":3,"file":"updateAuthFromVerifyResponse.d.ts","sourceRoot":"","sources":["../../../../../../../packages/client/src/modules/auth/updateAuthFromVerifyResponse/updateAuthFromVerifyResponse.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAGjE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAM3D,KAAK,kCAAkC,GAAG;IACxC,QAAQ,EAAE,cAAc,CAAC;CAC1B,CAAC;AAEF,eAAO,MAAM,4BAA4B,iBACzB,kCAAkC,UACxC,aAAa,SAiCtB,CAAC"}
1
+ {"version":3,"file":"updateAuthFromVerifyResponse.d.ts","sourceRoot":"","sources":["../../../../../../../packages/client/src/modules/auth/updateAuthFromVerifyResponse/updateAuthFromVerifyResponse.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAIjE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAM3D,KAAK,kCAAkC,GAAG;IACxC,QAAQ,EAAE,cAAc,CAAC;CAC1B,CAAC;AAEF,eAAO,MAAM,4BAA4B,iBACzB,kCAAkC,UACxC,aAAa,SAuCtB,CAAC"}