jazz-react-auth-clerk 0.8.13 → 0.8.15
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.md +20 -0
- package/dist/index.js +9 -14
- package/dist/index.js.map +1 -1
- package/package.json +4 -4
- package/src/index.tsx +11 -15
package/CHANGELOG.md
CHANGED
@@ -1,5 +1,25 @@
|
|
1
1
|
# jazz-browser-media-images
|
2
2
|
|
3
|
+
## 0.8.15
|
4
|
+
|
5
|
+
### Patch Changes
|
6
|
+
|
7
|
+
- 221c58f: Store clerk credentials in localStorage, and use if available
|
8
|
+
- Updated dependencies [cce679b]
|
9
|
+
- Updated dependencies [221c58f]
|
10
|
+
- jazz-tools@0.8.15
|
11
|
+
- jazz-browser-auth-clerk@0.8.15
|
12
|
+
- jazz-react@0.8.15
|
13
|
+
|
14
|
+
## 0.8.14
|
15
|
+
|
16
|
+
### Patch Changes
|
17
|
+
|
18
|
+
- Updated dependencies [36273b3]
|
19
|
+
- jazz-tools@0.8.14
|
20
|
+
- jazz-browser-auth-clerk@0.8.14
|
21
|
+
- jazz-react@0.8.14
|
22
|
+
|
3
23
|
## 0.8.13
|
4
24
|
|
5
25
|
### Patch Changes
|
package/dist/index.js
CHANGED
@@ -3,20 +3,15 @@ import { useState, useMemo } from "react";
|
|
3
3
|
export function useJazzClerkAuth(clerk) {
|
4
4
|
const [state, setState] = useState({ errors: [] });
|
5
5
|
const authMethod = useMemo(() => {
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
}, clerk);
|
16
|
-
}
|
17
|
-
else {
|
18
|
-
return undefined;
|
19
|
-
}
|
6
|
+
return new BrowserClerkAuth({
|
7
|
+
onError: (error) => {
|
8
|
+
void clerk.signOut();
|
9
|
+
setState((state) => ({
|
10
|
+
...state,
|
11
|
+
errors: [...state.errors, error.toString()],
|
12
|
+
}));
|
13
|
+
},
|
14
|
+
}, clerk);
|
20
15
|
}, [clerk.user]);
|
21
16
|
return [authMethod, state];
|
22
17
|
}
|
package/dist/index.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAA2B,MAAM,yBAAyB,CAAC;AACpF,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAE1C,MAAM,UAAU,gBAAgB,CAAC,KAEhC;IACG,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,QAAQ,CAAuB,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC,CAAC;IAEzE,MAAM,UAAU,GAAG,OAAO,CAAC,GAAG,EAAE;QAC5B,
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAA2B,MAAM,yBAAyB,CAAC;AACpF,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAE1C,MAAM,UAAU,gBAAgB,CAAC,KAEhC;IACG,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,QAAQ,CAAuB,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC,CAAC;IAEzE,MAAM,UAAU,GAAG,OAAO,CAAC,GAAG,EAAE;QAC5B,OAAO,IAAI,gBAAgB,CACvB;YACI,OAAO,EAAE,CAAC,KAAK,EAAE,EAAE;gBACf,KAAK,KAAK,CAAC,OAAO,EAAE,CAAC;gBACrB,QAAQ,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;oBACjB,GAAG,KAAK;oBACR,MAAM,EAAE,CAAC,GAAG,KAAK,CAAC,MAAM,EAAE,KAAK,CAAC,QAAQ,EAAE,CAAC;iBAC9C,CAAC,CAAC,CAAC;YACR,CAAC;SACJ,EACD,KAAK,CACR,CAAC;IACN,CAAC,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC;IAEjB,OAAO,CAAC,UAAU,EAAE,KAAK,CAAU,CAAC;AACxC,CAAC"}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "jazz-react-auth-clerk",
|
3
|
-
"version": "0.8.
|
3
|
+
"version": "0.8.15",
|
4
4
|
"type": "module",
|
5
5
|
"main": "dist/index.js",
|
6
6
|
"types": "src/index.tsx",
|
@@ -11,9 +11,9 @@
|
|
11
11
|
},
|
12
12
|
"dependencies": {
|
13
13
|
"cojson": "0.8.12",
|
14
|
-
"jazz-browser-auth-clerk": "0.8.
|
15
|
-
"jazz-react": "0.8.
|
16
|
-
"jazz-tools": "0.8.
|
14
|
+
"jazz-browser-auth-clerk": "0.8.15",
|
15
|
+
"jazz-react": "0.8.15",
|
16
|
+
"jazz-tools": "0.8.15"
|
17
17
|
},
|
18
18
|
"peerDependencies": {
|
19
19
|
"react": "^18.2.0"
|
package/src/index.tsx
CHANGED
@@ -7,22 +7,18 @@ export function useJazzClerkAuth(clerk: MinimalClerkClient & {
|
|
7
7
|
const [state, setState] = useState<{ errors: string[] }>({ errors: [] });
|
8
8
|
|
9
9
|
const authMethod = useMemo(() => {
|
10
|
-
|
11
|
-
|
12
|
-
{
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
}));
|
19
|
-
},
|
10
|
+
return new BrowserClerkAuth(
|
11
|
+
{
|
12
|
+
onError: (error) => {
|
13
|
+
void clerk.signOut();
|
14
|
+
setState((state) => ({
|
15
|
+
...state,
|
16
|
+
errors: [...state.errors, error.toString()],
|
17
|
+
}));
|
20
18
|
},
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
return undefined;
|
25
|
-
}
|
19
|
+
},
|
20
|
+
clerk,
|
21
|
+
);
|
26
22
|
}, [clerk.user]);
|
27
23
|
|
28
24
|
return [authMethod, state] as const;
|