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 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
- if (clerk.user) {
7
- return new BrowserClerkAuth({
8
- onError: (error) => {
9
- void clerk.signOut();
10
- setState((state) => ({
11
- ...state,
12
- errors: [...state.errors, error.toString()],
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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,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.13",
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.13",
15
- "jazz-react": "0.8.13",
16
- "jazz-tools": "0.8.13"
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
- if (clerk.user) {
11
- return new BrowserClerkAuth(
12
- {
13
- onError: (error) => {
14
- void clerk.signOut();
15
- setState((state) => ({
16
- ...state,
17
- errors: [...state.errors, error.toString()],
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
- clerk,
22
- );
23
- } else {
24
- return undefined;
25
- }
19
+ },
20
+ clerk,
21
+ );
26
22
  }, [clerk.user]);
27
23
 
28
24
  return [authMethod, state] as const;