Skip to content

Commit 6623f86

Browse files
committed
fix: Apply changes to Astro components
1 parent c84d316 commit 6623f86

File tree

2 files changed

+14
-11
lines changed

2 files changed

+14
-11
lines changed

.changeset/cyan-pots-attack.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
'@clerk/astro': patch
3+
'@clerk/clerk-react': patch
4+
'@clerk/types': patch
5+
---
6+
7+
Ensure proper typing for `SignUpButton` and only allow `unsafeMetadata={...}` when `mode="modal"`

packages/astro/src/react/SignUpButton.tsx

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,8 @@ export type { SignUpButtonProps };
77

88
export const SignUpButton = withClerk(
99
({ clerk, children, ...props }: WithClerkProp<React.PropsWithChildren<SignUpButtonProps>>) => {
10-
const {
11-
fallbackRedirectUrl,
12-
forceRedirectUrl,
13-
signInFallbackRedirectUrl,
14-
signInForceRedirectUrl,
15-
mode,
16-
unsafeMetadata,
17-
...rest
18-
} = props;
10+
const { fallbackRedirectUrl, forceRedirectUrl, signInFallbackRedirectUrl, signInForceRedirectUrl, mode, ...rest } =
11+
props;
1912

2013
children = normalizeWithDefaultValue(children, 'Sign up');
2114
const child = assertSingleChild(children)('SignUpButton');
@@ -26,15 +19,18 @@ export const SignUpButton = withClerk(
2619
forceRedirectUrl,
2720
signInFallbackRedirectUrl,
2821
signInForceRedirectUrl,
29-
unsafeMetadata,
3022
};
3123

3224
if (!clerk) {
3325
return;
3426
}
3527

3628
if (mode === 'modal') {
37-
return clerk.openSignUp({ ...opts, appearance: props.appearance });
29+
return clerk.openSignUp({
30+
...opts,
31+
appearance: props.appearance,
32+
unsafeMetadata: props.unsafeMetadata,
33+
});
3834
}
3935

4036
return clerk.redirectToSignUp({

0 commit comments

Comments
 (0)