@scayle/storefront-core 7.46.0 → 7.46.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.46.1
4
+
5
+ ### Patch Changes
6
+
7
+ - Revert breaking change in `handleIDPLoginCallback` signature
8
+
3
9
  ## 7.46.0
4
10
 
5
11
  ### Minor Changes
@@ -40,11 +40,10 @@ const getExternalIdpRedirect = exports.getExternalIdpRedirect = async function g
40
40
  }));
41
41
  return Object.fromEntries(results);
42
42
  };
43
- const handleIDPLoginCallback = exports.handleIDPLoginCallback = async function handleIDPLoginCallback2({
44
- code
45
- }, context) {
43
+ const handleIDPLoginCallback = exports.handleIDPLoginCallback = async function handleIDPLoginCallback2(payload, context) {
46
44
  (0, _types.assertSession)(context);
47
45
  const OAuthClient = (0, _oauth.getOAuthClient)(context);
46
+ const code = typeof payload === "string" ? payload : payload.code;
48
47
  const {
49
48
  access_token: accessToken,
50
49
  refresh_token: refreshToken
@@ -2,7 +2,7 @@ import type { RpcContext } from '../../../types';
2
2
  export declare const getExternalIdpRedirect: (context: RpcContext) => Promise<{
3
3
  [k: string]: string;
4
4
  }>;
5
- export declare const handleIDPLoginCallback: ({ code }: {
5
+ export declare const handleIDPLoginCallback: (payload: string | {
6
6
  code: string;
7
7
  }, context: RpcContext) => Promise<{
8
8
  message: string;
@@ -36,9 +36,10 @@ export const getExternalIdpRedirect = async function getExternalIdpRedirect2(con
36
36
  );
37
37
  return Object.fromEntries(results);
38
38
  };
39
- export const handleIDPLoginCallback = async function handleIDPLoginCallback2({ code }, context) {
39
+ export const handleIDPLoginCallback = async function handleIDPLoginCallback2(payload, context) {
40
40
  assertSession(context);
41
41
  const OAuthClient = getOAuthClient(context);
42
+ const code = typeof payload === "string" ? payload : payload.code;
42
43
  const { access_token: accessToken, refresh_token: refreshToken } = await OAuthClient.generateToken(code);
43
44
  context.updateTokens({
44
45
  accessToken,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@scayle/storefront-core",
3
- "version": "7.46.0",
3
+ "version": "7.46.1",
4
4
  "description": "Collection of essential utilities to work with the Storefront API",
5
5
  "author": "SCAYLE Commerce Engine",
6
6
  "license": "MIT",
@@ -64,26 +64,26 @@
64
64
  "jose": "5.2.3",
65
65
  "radash": "12.1.0",
66
66
  "slugify": "1.6.6",
67
- "ufo": "1.4.0",
67
+ "ufo": "1.5.3",
68
68
  "uncrypto": "0.1.3",
69
69
  "utility-types": "3.11.0"
70
70
  },
71
71
  "devDependencies": {
72
72
  "@scayle/eslint-config-storefront": "3.2.6",
73
73
  "@types/crypto-js": "4.2.2",
74
- "@types/node": "20.11.28",
74
+ "@types/node": "20.11.30",
75
75
  "@types/webpack-env": "1.18.4",
76
- "@vitest/coverage-v8": "1.3.1",
76
+ "@vitest/coverage-v8": "1.4.0",
77
77
  "dprint": "0.45.0",
78
78
  "eslint": "8.57.0",
79
79
  "eslint-formatter-gitlab": "5.1.0",
80
80
  "publint": "0.2.7",
81
81
  "rimraf": "5.0.5",
82
82
  "ts-node": "10.9.2",
83
- "typescript": "5.4.2",
83
+ "typescript": "5.4.3",
84
84
  "unbuild": "2.0.0",
85
85
  "unstorage": "1.10.2",
86
- "vitest": "1.3.1"
86
+ "vitest": "1.4.0"
87
87
  },
88
88
  "optionalDependencies": {
89
89
  "redis": "4"