@smg-automotive/auth 7.1.0-auth0-update-root.2 → 7.1.0-fix-swr-test-import.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.
|
@@ -4,6 +4,10 @@
|
|
|
4
4
|
var useSWR = require('swr');
|
|
5
5
|
var React = require('react');
|
|
6
6
|
|
|
7
|
+
function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : { default: e }; }
|
|
8
|
+
|
|
9
|
+
var React__default = /*#__PURE__*/_interopDefaultCompat(React);
|
|
10
|
+
|
|
7
11
|
const AuthContext = React.createContext(null);
|
|
8
12
|
const AuthProvider = ({ children, auth0Config, user, }) => {
|
|
9
13
|
const memoizedContext = React.useMemo(() => {
|
|
@@ -11,14 +15,14 @@ const AuthProvider = ({ children, auth0Config, user, }) => {
|
|
|
11
15
|
auth0Config,
|
|
12
16
|
};
|
|
13
17
|
}, [auth0Config]);
|
|
14
|
-
return (
|
|
18
|
+
return (React__default.default.createElement(useSWR.SWRConfig, { value: {
|
|
15
19
|
fallback: user
|
|
16
20
|
? {
|
|
17
21
|
[auth0Config.userProfileEndpoint]: user,
|
|
18
22
|
}
|
|
19
23
|
: {},
|
|
20
24
|
} },
|
|
21
|
-
|
|
25
|
+
React__default.default.createElement(AuthContext.Provider, { value: memoizedContext }, children)));
|
|
22
26
|
};
|
|
23
27
|
|
|
24
28
|
exports.AuthContext = AuthContext;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Auth.js","sources":["../../../../../src/client/contexts/Auth.tsx"],"sourcesContent":[null],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Auth.js","sources":["../../../../../src/client/contexts/Auth.tsx"],"sourcesContent":[null],"names":[],"mappings":";;;;;;;;;;;AAkBO;AAKL;;;;AAIA;AAEA;AAGM;AACE;AACI;AACD;AACH;AACH;AAED;AAKN;;;"}
|
|
@@ -5,6 +5,10 @@ var useSWR = require('swr');
|
|
|
5
5
|
var React = require('react');
|
|
6
6
|
var useAuthConfig = require('./useAuthConfig.js');
|
|
7
7
|
|
|
8
|
+
function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : { default: e }; }
|
|
9
|
+
|
|
10
|
+
var useSWR__default = /*#__PURE__*/_interopDefaultCompat(useSWR);
|
|
11
|
+
|
|
8
12
|
const userFetcher = async (url) => {
|
|
9
13
|
const response = await fetch(url);
|
|
10
14
|
if (!response.ok) {
|
|
@@ -14,7 +18,7 @@ const userFetcher = async (url) => {
|
|
|
14
18
|
};
|
|
15
19
|
const useUser = () => {
|
|
16
20
|
const config = useAuthConfig.useAuthConfig();
|
|
17
|
-
const { data, error, isLoading, mutate } =
|
|
21
|
+
const { data, error, isLoading, mutate } = useSWR__default.default(config.userProfileEndpoint, userFetcher);
|
|
18
22
|
const invalidate = React.useCallback(() => mutate(), [mutate]);
|
|
19
23
|
return {
|
|
20
24
|
user: data ?? null,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useUser.js","sources":["../../../../../src/client/hooks/useUser.ts"],"sourcesContent":[null],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useUser.js","sources":["../../../../../src/client/hooks/useUser.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;;;;;;;;AASA;AACE;AACA;AACE;;AAGF;AACF;AAEO;AACL;AAEA;AAMA;;;;;;;AAQF;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@smg-automotive/auth",
|
|
3
|
-
"version": "7.1.0-
|
|
3
|
+
"version": "7.1.0-fix-swr-test-import.1",
|
|
4
4
|
"description": "SMG Automotive auth package",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": {
|
|
@@ -63,12 +63,12 @@
|
|
|
63
63
|
"@rollup/plugin-commonjs": "28.0.6",
|
|
64
64
|
"@rollup/plugin-node-resolve": "16.0.1",
|
|
65
65
|
"@rollup/plugin-typescript": "12.1.4",
|
|
66
|
-
"@smg-automotive/eslint-config": "5.1.
|
|
66
|
+
"@smg-automotive/eslint-config": "5.1.7",
|
|
67
67
|
"@testing-library/dom": "10.4.1",
|
|
68
68
|
"@testing-library/jest-dom": "6.8.0",
|
|
69
69
|
"@testing-library/react": "16.3.0",
|
|
70
70
|
"@testing-library/user-event": "14.6.1",
|
|
71
|
-
"@types/react": "19.1.
|
|
71
|
+
"@types/react": "19.1.13",
|
|
72
72
|
"dotenv": "17.2.2",
|
|
73
73
|
"jest": "30.0.5",
|
|
74
74
|
"jest-environment-jsdom": "30.0.5",
|
|
@@ -77,13 +77,13 @@
|
|
|
77
77
|
"react": "19.1.1",
|
|
78
78
|
"react-dom": "19.1.1",
|
|
79
79
|
"rimraf": "6.0.1",
|
|
80
|
-
"rollup": "4.
|
|
80
|
+
"rollup": "4.52.2",
|
|
81
81
|
"rollup-plugin-dts": "6.2.3",
|
|
82
82
|
"rollup-plugin-peer-deps-external": "2.2.4",
|
|
83
83
|
"rollup-plugin-preserve-directives": "0.4.0",
|
|
84
|
-
"semantic-release": "24.2.
|
|
84
|
+
"semantic-release": "24.2.9",
|
|
85
85
|
"swr": "2.3.6",
|
|
86
|
-
"ts-jest": "29.4.
|
|
86
|
+
"ts-jest": "29.4.4",
|
|
87
87
|
"ts-node": "10.9.2",
|
|
88
88
|
"typescript": "5.9.2",
|
|
89
89
|
"whatwg-fetch": "3.6.20"
|