Skip to content

Commit 453695c

Browse files
committed
Merge branch 'main' into feat/signal-handshake-nonce-support-oauth
2 parents 1d60de9 + 5491491 commit 453695c

File tree

168 files changed

+4028
-596
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

168 files changed

+4028
-596
lines changed

.changeset/bright-wombats-invite.md

-5
This file was deleted.

.changeset/full-bushes-heal.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@clerk/types': minor
3+
---
4+
5+
Add `onClose` to `__internal_CheckoutProps`.

.changeset/good-wasps-find.md

-5
This file was deleted.

.changeset/little-cases-knock.md

-5
This file was deleted.

.changeset/long-bananas-agree.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@clerk/clerk-js': patch
3+
---
4+
5+
Bug fix: Call `setActive` after closing Checkout to ensure RSCs re-render with the new auth context.

.changeset/mighty-forks-joke.md

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
'@clerk/clerk-js': patch
3+
'@clerk/types': patch
4+
---
5+
6+
Add `drawerRoot` descriptor and adjust z-index approach.

.changeset/ready-places-arrive.md

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
'@clerk/localizations': minor
3+
'@clerk/clerk-js': minor
4+
'@clerk/types': minor
5+
---
6+
7+
Replaces strings with localizations throughout billing components.

.changeset/stupid-gifts-juggle.md

-5
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
---
2-
import { #Table } from "@clerk/astro/components";
3-
import Layout from "../layouts/Layout.astro";
2+
import { #Table } from '@clerk/astro/components';
3+
import Layout from '../layouts/Layout.astro';
4+
5+
const newSubscriptionRedirectUrl = Astro.url.searchParams.get('newSubscriptionRedirectUrl');
46
---
57

6-
<Layout title="# Table">
7-
<div class="w-full flex justify-center">
8-
<#Table />
8+
<Layout title='# Table'>
9+
<div class='w-full flex justify-center'>
10+
<#Table newSubscriptionRedirectUrl={newSubscriptionRedirectUrl} />
911
</div>
1012
</Layout>
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,23 @@
1-
import { #Table } from '@clerk/nextjs';
1+
import { #Table, Protect } from '@clerk/nextjs';
22

3-
export default function #TablePage() {
4-
return <#Table />;
3+
export default async function #TablePage({
4+
searchParams,
5+
}: {
6+
searchParams: Promise<{ newSubscriptionRedirectUrl: string }>;
7+
}) {
8+
const newSubscriptionRedirectUrl = (await searchParams).newSubscriptionRedirectUrl;
9+
return (
10+
<>
11+
<Protect plan='free_user'>
12+
<p>user in free</p>
13+
</Protect>
14+
<Protect plan='pro'>
15+
<p>user in pro</p>
16+
</Protect>
17+
<Protect plan='plus'>
18+
<p>user in plus</p>
19+
</Protect>
20+
<#Table newSubscriptionRedirectUrl={newSubscriptionRedirectUrl} />
21+
</>
22+
);
523
}
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
11
<template>
2-
<#Table />
2+
<#Table :newSubscriptionRedirectUrl="newSubscriptionRedirectUrl" />
33
</template>
4+
5+
<script setup>
6+
import { useRoute } from 'vue-router';
7+
8+
const route = useRoute();
9+
const newSubscriptionRedirectUrl = route.query.newSubscriptionRedirectUrl;
10+
</script>
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
<script setup lang="ts">
22
import { #Table } from '@clerk/vue';
3+
import { useRoute } from 'vue-router';
4+
5+
const route = useRoute();
6+
const newSubscriptionRedirectUrl = route.query.newSubscriptionRedirectUrl as string;
37
</script>
48

59
<template>
6-
<#Table />
10+
<#Table :newSubscriptionRedirectUrl="newSubscriptionRedirectUrl" />
711
</template>

integration/tests/#-table.test.ts

+71
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,15 @@ testAgainstRunningApps({ withEnv: [appConfigs.envs.withBilling] })('# tabl
6262
await u.po.checkout.fillTestCard();
6363
await u.po.checkout.clickPayOrSubscribe();
6464
await expect(u.po.page.getByText('Payment was successful!')).toBeVisible();
65+
await u.po.checkout.confirmAndContinue();
66+
67+
// eslint-disable-next-line playwright/no-conditional-in-test
68+
if (app.name.includes('next')) {
69+
// Correctly updates RSCs with the new `pla` claim.
70+
await expect(u.po.page.getByText('user in plus')).toBeVisible({
71+
timeout: 5_000,
72+
});
73+
}
6574
});
6675

6776
test('can upgrade to a new plan with saved card', async ({ page, context }) => {
@@ -104,6 +113,42 @@ testAgainstRunningApps({ withEnv: [appConfigs.envs.withBilling] })('# tabl
104113
// await expect(u.po.page.getByRole('button', { name: /resubscribe|re-subscribe/i }).first()).toBeVisible();
105114
// });
106115

116+
test.describe('redirects', () => {
117+
test('default navigates to afterSignInUrl', async ({ page, context }) => {
118+
const u = createTestUtils({ app, page, context });
119+
await u.po.signIn.goTo();
120+
await u.po.signIn.signInWithEmailAndInstantPassword({ email: fakeUser.email, password: fakeUser.password });
121+
await u.po.page.goToRelative('/#-table');
122+
await u.po.#Table.waitForMounted();
123+
await u.po.#Table.startCheckout({ planSlug: 'pro' });
124+
await u.po.checkout.waitForMounted();
125+
await u.po.checkout.clickPayOrSubscribe();
126+
await expect(u.po.page.getByText('Success!')).toBeVisible();
127+
await page
128+
.locator('.cl-checkout-root')
129+
.getByRole('button', { name: /^continue$/i })
130+
.click();
131+
await u.page.waitForAppUrl('/');
132+
});
133+
134+
test('navigates to supplied newSubscriptionRedirectUrl', async ({ page, context }) => {
135+
const u = createTestUtils({ app, page, context });
136+
await u.po.signIn.goTo();
137+
await u.po.signIn.signInWithEmailAndInstantPassword({ email: fakeUser.email, password: fakeUser.password });
138+
await u.po.page.goToRelative('/#-table?newSubscriptionRedirectUrl=/success');
139+
await u.po.#Table.waitForMounted();
140+
await u.po.#Table.startCheckout({ planSlug: 'plus' });
141+
await u.po.checkout.waitForMounted();
142+
await u.po.checkout.clickPayOrSubscribe();
143+
await expect(u.po.page.getByText('Success!')).toBeVisible();
144+
await page
145+
.locator('.cl-checkout-root')
146+
.getByRole('button', { name: /^continue$/i })
147+
.click();
148+
await u.page.waitForAppUrl('/success');
149+
});
150+
});
151+
107152
test.describe('in UserProfile', () => {
108153
test('renders # table with plans', async ({ page, context }) => {
109154
const u = createTestUtils({ app, page, context });
@@ -117,5 +162,31 @@ testAgainstRunningApps({ withEnv: [appConfigs.envs.withBilling] })('# tabl
117162
await u.po.#Table.waitForMounted();
118163
await expect(u.po.page.getByRole('heading', { name: 'Pro' })).toBeVisible();
119164
});
165+
166+
test('can subscribe to a plan and revalidate payment sources', async ({ page, context }) => {
167+
const u = createTestUtils({ app, page, context });
168+
169+
const fakeUser = u.services.users.createFakeUser();
170+
await u.services.users.createBapiUser(fakeUser);
171+
172+
await u.po.signIn.goTo();
173+
await u.po.signIn.signInWithEmailAndInstantPassword({ email: fakeUser.email, password: fakeUser.password });
174+
await u.po.page.goToRelative('/user');
175+
176+
await u.po.userProfile.waitForMounted();
177+
await u.po.userProfile.switchToBillingTab();
178+
await u.po.page.getByRole('button', { name: 'Switch plans' }).click();
179+
await u.po.#Table.startCheckout({ planSlug: 'plus' });
180+
await u.po.checkout.waitForMounted();
181+
await u.po.checkout.fillTestCard();
182+
await u.po.checkout.clickPayOrSubscribe();
183+
await expect(u.po.page.getByText('Payment was successful!')).toBeVisible();
184+
185+
await u.po.checkout.confirmAndContinue();
186+
await u.po.#Table.startCheckout({ planSlug: 'free_user', shouldSwitch: true });
187+
await u.po.checkout.waitForSubscribeButton();
188+
189+
await fakeUser.deleteIfExists();
190+
});
120191
});
121192
});

packages/agent-toolkit/CHANGELOG.md

+9
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
# @clerk/agent-toolkit
22

3+
## 0.0.35
4+
5+
### Patch Changes
6+
7+
- Updated dependencies [[`1ff6d6e`](https://github.com/clerk/javascript/commit/1ff6d6efbe838b3f7f6977b2b5215c2cafd715f6), [`fbf3cf4`](https://github.com/clerk/javascript/commit/fbf3cf4916469c4e118870bf12efca2d0f77d9d8)]:
8+
- @clerk/shared@3.9.0
9+
- @clerk/types@4.58.1
10+
- @clerk/backend@1.32.1
11+
312
## 0.0.34
413

514
### Patch Changes

packages/agent-toolkit/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@clerk/agent-toolkit",
3-
"version": "0.0.34",
3+
"version": "0.0.35",
44
"description": "Clerk Toolkit for AI Agents",
55
"homepage": "https://clerk.com/",
66
"bugs": {

packages/astro/CHANGELOG.md

+9
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
# @clerk/astro
22

3+
## 2.7.3
4+
5+
### Patch Changes
6+
7+
- Updated dependencies [[`1ff6d6e`](https://github.com/clerk/javascript/commit/1ff6d6efbe838b3f7f6977b2b5215c2cafd715f6), [`fbf3cf4`](https://github.com/clerk/javascript/commit/fbf3cf4916469c4e118870bf12efca2d0f77d9d8)]:
8+
- @clerk/shared@3.9.0
9+
- @clerk/types@4.58.1
10+
- @clerk/backend@1.32.1
11+
312
## 2.7.2
413

514
### Patch Changes

packages/astro/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@clerk/astro",
3-
"version": "2.7.2",
3+
"version": "2.7.3",
44
"description": "Clerk SDK for Astro",
55
"keywords": [
66
"auth",

packages/backend/CHANGELOG.md

+8
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
# Change Log
22

3+
## 1.32.1
4+
5+
### Patch Changes
6+
7+
- Updated dependencies [[`1ff6d6e`](https://github.com/clerk/javascript/commit/1ff6d6efbe838b3f7f6977b2b5215c2cafd715f6), [`fbf3cf4`](https://github.com/clerk/javascript/commit/fbf3cf4916469c4e118870bf12efca2d0f77d9d8)]:
8+
- @clerk/shared@3.9.0
9+
- @clerk/types@4.58.1
10+
311
## 1.32.0
412

513
### Minor Changes

packages/backend/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@clerk/backend",
3-
"version": "1.32.0",
3+
"version": "1.32.1",
44
"description": "Clerk Backend SDK - REST Client for Backend API & JWT verification utilities",
55
"homepage": "https://clerk.com/",
66
"bugs": {

packages/chrome-extension/CHANGELOG.md

+9
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
# Change Log
22

3+
## 2.4.4
4+
5+
### Patch Changes
6+
7+
- Updated dependencies [[`1ff6d6e`](https://github.com/clerk/javascript/commit/1ff6d6efbe838b3f7f6977b2b5215c2cafd715f6), [`fbfcff3`](https://github.com/clerk/javascript/commit/fbfcff384869bf366d06b5eb68b9913aabb0311d), [`fbf3cf4`](https://github.com/clerk/javascript/commit/fbf3cf4916469c4e118870bf12efca2d0f77d9d8), [`bde228d`](https://github.com/clerk/javascript/commit/bde228d158848c7ea07177bf3d59c6d705861ba3), [`2c4ba8a`](https://github.com/clerk/javascript/commit/2c4ba8aab502c09cf452e9a3d3dc9825a5af4614), [`0801b02`](https://github.com/clerk/javascript/commit/0801b0297b75deac310be67fa08d855b8deccb94), [`db162dc`](https://github.com/clerk/javascript/commit/db162dcefa06b9e60d4da08fe16330468e57cd40), [`2b18d7a`](https://github.com/clerk/javascript/commit/2b18d7a0fd916b1f052edf5951363603390d6dc3)]:
8+
- @clerk/clerk-js@5.66.0
9+
- @clerk/shared@3.9.0
10+
- @clerk/clerk-react@5.31.3
11+
312
## 2.4.3
413

514
### Patch Changes

packages/chrome-extension/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@clerk/chrome-extension",
3-
"version": "2.4.3",
3+
"version": "2.4.4",
44
"description": "Clerk SDK for Chrome extensions",
55
"keywords": [
66
"auth",

packages/clerk-js/CHANGELOG.md

+29
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,34 @@
11
# Change Log
22

3+
## 5.66.0
4+
5+
### Minor Changes
6+
7+
- Introduce `WhatsApp` as an alternative channel for phone code delivery. ([#5894](https://github.com/clerk/javascript/pull/5894)) by [@anagstef](https://github.com/anagstef)
8+
9+
The new `channel` property accompanies the `phone_code` strategy. Possible values: `whatsapp` and `sms`.
10+
11+
### Patch Changes
12+
13+
- Fixes incorrect heading spacing within PlanDetails drawer header ([#5918](https://github.com/clerk/javascript/pull/5918)) by [@alexcarpenter](https://github.com/alexcarpenter)
14+
15+
- Display a better subscription list / button when empty and the free plan is hidden ([#5912](https://github.com/clerk/javascript/pull/5912)) by [@aeliox](https://github.com/aeliox)
16+
17+
- Improvements of flows for switching between plans ([#5883](https://github.com/clerk/javascript/pull/5883)) by [@octoper](https://github.com/octoper)
18+
19+
- Bug fix: Revalidate payment methods after checking out with test card. ([#5913](https://github.com/clerk/javascript/pull/5913)) by [@panteliselef](https://github.com/panteliselef)
20+
21+
- Ensure Checkout drawer animation and content respects RTL usage. ([#5906](https://github.com/clerk/javascript/pull/5906)) by [@alexcarpenter](https://github.com/alexcarpenter)
22+
23+
- Fixes issue in Safari where navigating between profile tabs caused the navbar icons to shift unexpectedly. ([#5887](https://github.com/clerk/javascript/pull/5887)) by [@alexcarpenter](https://github.com/alexcarpenter)
24+
25+
- Fixes `newSubscriptionRedirectUrl` usage on `#Table`. ([#5909](https://github.com/clerk/javascript/pull/5909)) by [@alexcarpenter](https://github.com/alexcarpenter)
26+
27+
- Updated dependencies [[`36c6f8f`](https://github.com/clerk/javascript/commit/36c6f8fe389389d2af33106fb7ca2ffeb5513407), [`1ff6d6e`](https://github.com/clerk/javascript/commit/1ff6d6efbe838b3f7f6977b2b5215c2cafd715f6), [`68a7b40`](https://github.com/clerk/javascript/commit/68a7b40e5ffd040bcdad11b7f8a8a3c6ad7569ea), [`f288881`](https://github.com/clerk/javascript/commit/f28888134e46c1b70a776fd8c6aa24293308b7cb), [`fbf3cf4`](https://github.com/clerk/javascript/commit/fbf3cf4916469c4e118870bf12efca2d0f77d9d8)]:
28+
- @clerk/localizations@3.15.3
29+
- @clerk/shared@3.9.0
30+
- @clerk/types@4.58.1
31+
332
## 5.65.0
433

534
### Minor Changes

packages/clerk-js/bundlewatch.config.json

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
{
22
"files": [
3-
{ "path": "./dist/clerk.js", "maxSize": "594kB" },
4-
{ "path": "./dist/clerk.browser.js", "maxSize": "68.3KB" },
3+
{ "path": "./dist/clerk.js", "maxSize": "595.7kB" },
4+
{ "path": "./dist/clerk.browser.js", "maxSize": "68.5KB" },
55
{ "path": "./dist/clerk.legacy.browser.js", "maxSize": "110KB" },
66
{ "path": "./dist/clerk.headless*.js", "maxSize": "52KB" },
7-
{ "path": "./dist/ui-common*.js", "maxSize": "104.20KB" },
7+
{ "path": "./dist/ui-common*.js", "maxSize": "105.1KB" },
88
{ "path": "./dist/vendors*.js", "maxSize": "39.5KB" },
99
{ "path": "./dist/coinbase*.js", "maxSize": "38KB" },
1010
{ "path": "./dist/createorganization*.js", "maxSize": "5KB" },
@@ -13,15 +13,15 @@
1313
{ "path": "./dist/organizationswitcher*.js", "maxSize": "5KB" },
1414
{ "path": "./dist/organizationlist*.js", "maxSize": "5.5KB" },
1515
{ "path": "./dist/signin*.js", "maxSize": "14KB" },
16-
{ "path": "./dist/#*.js", "maxSize": "6.76KB" },
16+
{ "path": "./dist/#*.js", "maxSize": "7.4KB" },
1717
{ "path": "./dist/userbutton*.js", "maxSize": "5KB" },
1818
{ "path": "./dist/userprofile*.js", "maxSize": "16.5KB" },
1919
{ "path": "./dist/userverification*.js", "maxSize": "5KB" },
2020
{ "path": "./dist/onetap*.js", "maxSize": "1KB" },
2121
{ "path": "./dist/waitlist*.js", "maxSize": "1.3KB" },
2222
{ "path": "./dist/keylessPrompt*.js", "maxSize": "6.5KB" },
2323
{ "path": "./dist/#Table*.js", "maxSize": "4.02KB" },
24-
{ "path": "./dist/checkout*.js", "maxSize": "5.95KB" },
24+
{ "path": "./dist/checkout*.js", "maxSize": "6.05KB" },
2525
{ "path": "./dist/paymentSources*.js", "maxSize": "9.06KB" },
2626
{ "path": "./dist/up-billing-page*.js", "maxSize": "3.0KB" },
2727
{ "path": "./dist/op-billing-page*.js", "maxSize": "3.0KB" },

packages/clerk-js/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@clerk/clerk-js",
3-
"version": "5.65.0",
3+
"version": "5.66.0",
44
"description": "Clerk JS library",
55
"keywords": [
66
"clerk",

packages/clerk-js/src/core/resources/SignIn.ts

+1
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,7 @@ export class SignIn extends BaseResource implements SignInResource {
120120
config = {
121121
phoneNumberId: factor.phoneNumberId,
122122
default: factor.default,
123+
channel: factor.channel,
123124
} as PhoneCodeConfig;
124125
break;
125126
case 'web3_metamask_signature':

0 commit comments

Comments
 (0)