@cedarjs/auth-clerk-setup 1.1.1-next.0 → 1.1.1-next.21
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/dist/setupHandler.js
CHANGED
|
@@ -44,7 +44,7 @@ const handler = async ({ force: forceArg }) => {
|
|
|
44
44
|
authDecoderImport: `import { clerkAuthDecoder as authDecoder } from '@cedarjs/auth-clerk-api'`,
|
|
45
45
|
provider: "clerk",
|
|
46
46
|
webPackages: [
|
|
47
|
-
"@clerk/clerk-react@^
|
|
47
|
+
"@clerk/clerk-react@^5",
|
|
48
48
|
`@cedarjs/auth-clerk-web@${version}`
|
|
49
49
|
],
|
|
50
50
|
apiPackages: [`@cedarjs/auth-clerk-api@${version}`],
|
|
@@ -22,9 +22,7 @@ const ClerkStatusUpdater = () => {
|
|
|
22
22
|
return null
|
|
23
23
|
}
|
|
24
24
|
|
|
25
|
-
type ClerkOptions =
|
|
26
|
-
| { publishableKey: string; frontendApi?: never }
|
|
27
|
-
| { publishableKey?: never; frontendApi: string }
|
|
25
|
+
type ClerkOptions = { publishableKey: string }
|
|
28
26
|
|
|
29
27
|
interface Props {
|
|
30
28
|
children: React.ReactNode
|
|
@@ -39,7 +37,8 @@ const ClerkProviderWrapper = ({
|
|
|
39
37
|
return (
|
|
40
38
|
<ClerkProvider
|
|
41
39
|
{...clerkOptions}
|
|
42
|
-
|
|
40
|
+
routerPush={(to) => reauthenticate().then(() => navigate(to))}
|
|
41
|
+
routerReplace={(to) => reauthenticate().then(() => navigate(to, { replace: true }))}
|
|
43
42
|
>
|
|
44
43
|
{children}
|
|
45
44
|
<ClerkStatusUpdater />
|
|
@@ -49,16 +48,10 @@ const ClerkProviderWrapper = ({
|
|
|
49
48
|
|
|
50
49
|
export const AuthProvider = ({ children }: Props) => {
|
|
51
50
|
const publishableKey = process.env.CLERK_PUBLISHABLE_KEY
|
|
52
|
-
const frontendApi =
|
|
53
|
-
process.env.CLERK_FRONTEND_API_URL || process.env.CLERK_FRONTEND_API
|
|
54
|
-
|
|
55
|
-
const clerkOptions: ClerkOptions = publishableKey
|
|
56
|
-
? { publishableKey }
|
|
57
|
-
: { frontendApi }
|
|
58
51
|
|
|
59
52
|
return (
|
|
60
53
|
<ClerkRwAuthProvider>
|
|
61
|
-
<ClerkProviderWrapper clerkOptions={
|
|
54
|
+
<ClerkProviderWrapper clerkOptions={{ publishableKey }}>
|
|
62
55
|
{children}
|
|
63
56
|
</ClerkProviderWrapper>
|
|
64
57
|
</ClerkRwAuthProvider>
|
|
@@ -20,9 +20,7 @@ const ClerkStatusUpdater = () => {
|
|
|
20
20
|
return null
|
|
21
21
|
}
|
|
22
22
|
|
|
23
|
-
type ClerkOptions =
|
|
24
|
-
| { publishableKey: string; frontendApi?: never }
|
|
25
|
-
| { publishableKey?: never; frontendApi: string }
|
|
23
|
+
type ClerkOptions = { publishableKey: string }
|
|
26
24
|
|
|
27
25
|
interface Props {
|
|
28
26
|
children: React.ReactNode
|
|
@@ -37,7 +35,8 @@ const ClerkProviderWrapper = ({
|
|
|
37
35
|
return (
|
|
38
36
|
<ClerkProvider
|
|
39
37
|
{...clerkOptions}
|
|
40
|
-
|
|
38
|
+
routerPush={(to) => reauthenticate().then(() => navigate(to))}
|
|
39
|
+
routerReplace={(to) => reauthenticate().then(() => navigate(to, { replace: true }))}
|
|
41
40
|
>
|
|
42
41
|
{children}
|
|
43
42
|
<ClerkStatusUpdater />
|
|
@@ -47,16 +46,10 @@ const ClerkProviderWrapper = ({
|
|
|
47
46
|
|
|
48
47
|
export const AuthProvider = ({ children }: Props) => {
|
|
49
48
|
const publishableKey = process.env.CLERK_PUBLISHABLE_KEY
|
|
50
|
-
const frontendApi =
|
|
51
|
-
process.env.CLERK_FRONTEND_API_URL || process.env.CLERK_FRONTEND_API
|
|
52
|
-
|
|
53
|
-
const clerkOptions: ClerkOptions = publishableKey
|
|
54
|
-
? { publishableKey }
|
|
55
|
-
: { frontendApi }
|
|
56
49
|
|
|
57
50
|
return (
|
|
58
51
|
<ClerkRwAuthProvider>
|
|
59
|
-
<ClerkProviderWrapper clerkOptions={
|
|
52
|
+
<ClerkProviderWrapper clerkOptions={{ publishableKey }}>
|
|
60
53
|
{children}
|
|
61
54
|
</ClerkProviderWrapper>
|
|
62
55
|
</ClerkRwAuthProvider>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cedarjs/auth-clerk-setup",
|
|
3
|
-
"version": "1.1.1-next.
|
|
3
|
+
"version": "1.1.1-next.21+77cfbaa90",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git+https://github.com/cedarjs/cedar.git",
|
|
@@ -37,11 +37,11 @@
|
|
|
37
37
|
"prepublishOnly": "NODE_ENV=production yarn build"
|
|
38
38
|
},
|
|
39
39
|
"dependencies": {
|
|
40
|
-
"@cedarjs/cli-helpers": "1.1.1-next.
|
|
40
|
+
"@cedarjs/cli-helpers": "1.1.1-next.21+77cfbaa90"
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
43
|
"@arethetypeswrong/cli": "0.18.2",
|
|
44
|
-
"@cedarjs/framework-tools": "1.1.1-next.
|
|
44
|
+
"@cedarjs/framework-tools": "1.1.1-next.21",
|
|
45
45
|
"@types/yargs": "17.0.33",
|
|
46
46
|
"concurrently": "8.2.2",
|
|
47
47
|
"publint": "0.3.12",
|
|
@@ -51,5 +51,5 @@
|
|
|
51
51
|
"publishConfig": {
|
|
52
52
|
"access": "public"
|
|
53
53
|
},
|
|
54
|
-
"gitHead": "
|
|
54
|
+
"gitHead": "77cfbaa90a726923a763fb33b836638d94b2d431"
|
|
55
55
|
}
|