@scayle/storefront-core 7.40.0 → 7.40.1

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,5 +1,11 @@
1
1
  # @scayle/storefront-core
2
2
 
3
+ ## 7.40.1
4
+
5
+ ### Patch Changes
6
+
7
+ - patch accessToken on refreshUser RPC Method
8
+
3
9
  ## 7.40.0
4
10
 
5
11
  ### Minor Changes
@@ -38,14 +38,14 @@ const refreshUser = exports.refreshUser = async function refreshUser2(context) {
38
38
  const client = new _customer.CustomerAPIClient(context);
39
39
  try {
40
40
  const user = await client.getMe(shopId);
41
- context.updateUser({
42
- ...user,
43
- authentication: user.authentication ? {
44
- ...user.authentication,
45
- storefrontAccessToken: accessToken
46
- } : void 0,
47
- loginShopId: shopId
48
- });
41
+ if (!user.authentication) {
42
+ user.authentication = {
43
+ type: "idp"
44
+ };
45
+ }
46
+ user.authentication.storefrontAccessToken = accessToken;
47
+ user.loginShopId = shopId;
48
+ context.updateUser(user);
49
49
  return {
50
50
  user
51
51
  };
@@ -25,14 +25,14 @@ const refreshUser = async function refreshUser2(context) {
25
25
  const client = new CustomerAPIClient(context);
26
26
  try {
27
27
  const user = await client.getMe(shopId);
28
- context.updateUser({
29
- ...user,
30
- authentication: user.authentication ? {
31
- ...user.authentication,
32
- storefrontAccessToken: accessToken
33
- } : void 0,
34
- loginShopId: shopId
35
- });
28
+ if (!user.authentication) {
29
+ user.authentication = {
30
+ type: "idp"
31
+ };
32
+ }
33
+ user.authentication.storefrontAccessToken = accessToken;
34
+ user.loginShopId = shopId;
35
+ context.updateUser(user);
36
36
  return { user };
37
37
  } catch {
38
38
  await context.destroySession();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@scayle/storefront-core",
3
- "version": "7.40.0",
3
+ "version": "7.40.1",
4
4
  "description": "Collection of essential utilities to work with the Storefront API",
5
5
  "author": "SCAYLE Commerce Engine",
6
6
  "license": "MIT",