Skip to content

Commit 2f5d4ca

Browse files
committed
Merge branch 'main' into roy/create-js-only-createClerkClient-for-extensions
2 parents 772fe39 + 64af60c commit 2f5d4ca

56 files changed

Lines changed: 689 additions & 278 deletions

Some content is hidden

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

.changeset/cold-moose-dance.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
---
2+
"@clerk/backend": major
3+
---
4+
5+
Remove deprecated verify methods in favor of `verify()`.
6+
7+
**`apiKeys.verifySecret()` removed**
8+
9+
```ts
10+
// Before
11+
await clerkClient.apiKeys.verifySecret(secret);
12+
13+
// After
14+
await clerkClient.apiKeys.verify(secret);
15+
```
16+
17+
**`idpOAuthAccessToken.verifyAccessToken()` removed**
18+
19+
```ts
20+
// Before
21+
await clerkClient.idpOAuthAccessToken.verifyAccessToken(accessToken);
22+
23+
// After
24+
await clerkClient.idpOAuthAccessToken.verify(accessToken);
25+
```
26+
27+
**`m2m.verifyToken()` removed**
28+
29+
```ts
30+
// Before
31+
await clerkClient.m2m.verifyToken(params);
32+
33+
// After
34+
await clerkClient.m2m.verify(params);
35+
```
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@clerk/backend': patch
3+
---
4+
5+
Warn when a cookie-based session token is missing the `azp` claim instead of rejecting the token. This prepares consumers for a future version where the `azp` claim will be required.

.changeset/cyan-shoes-return.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
'@clerk/clerk-js': minor
3+
'@clerk/shared': minor
4+
'@clerk/ui': minor
5+
---
6+
7+
Don't display impersonation overlay for agents
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
'@clerk/shared': patch
3+
'@clerk/clerk-js': patch
4+
'@clerk/nextjs': patch
5+
'@clerk/astro': patch
6+
'@clerk/chrome-extension': patch
7+
---
8+
9+
Rename dev browser APIs to remove JWT terminology. The dev browser identifier is now a generic ID, so internal naming has been updated to reflect this. No runtime behavior changes.

.changeset/fresh-eyes-drop.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
---
2+
"@clerk/express": major
3+
---
4+
5+
Remove deprecated `enableHandshake` option and `req.auth` object-access pattern.
6+
7+
**`enableHandshake` removed**
8+
9+
This option had no effect and was previously deprecated. Remove it from your `clerkMiddleware` call:
10+
11+
```ts
12+
// Before
13+
app.use(clerkMiddleware({ enableHandshake: false }));
14+
15+
// After
16+
app.use(clerkMiddleware());
17+
```
18+
19+
**`req.auth` must now be called as a function**
20+
21+
Accessing `req.auth` as a plain object (legacy `clerk-sdk-node` style) no longer works. Use `getAuth()` instead:
22+
23+
```ts
24+
// Before
25+
const { userId } = req.auth;
26+
27+
// After
28+
const { userId } = getAuth(req);
29+
```

.changeset/nice-jobs-sort.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@clerk/react': minor
3+
---
4+
5+
Get transferable state in sign in proxy.

.changeset/rude-pans-study.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@clerk/upgrade": patch
3+
---
4+
5+
fix(upgrade): add package replacement for @clerk/themes@clerk/ui

integration/templates/express-vite/src/server/main.ts

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -22,28 +22,5 @@ app.get('/api/protected', (req: any, res: any, _next: any) => {
2222
res.send('Protected API response');
2323
});
2424

25-
const legacyRequireAuth = (req: any, _res: any, next: any) => {
26-
if (!req.auth.userId) {
27-
return next(new Error('Unauthorized'));
28-
}
29-
30-
next();
31-
};
32-
33-
app.get('/api/legacy/protected', legacyRequireAuth, (_req: any, res: any, _next: any) => {
34-
res.send('Protected API response');
35-
});
36-
37-
// Handle authentication error, otherwise application will crash
38-
// @ts-ignore
39-
app.use((err, req, res, next) => {
40-
if (err) {
41-
res.status(401).send('Unauthorized');
42-
return;
43-
}
44-
45-
return next();
46-
});
47-
4825
const port = parseInt(process.env.PORT as string) || 3002;
4926
ViteExpress.listen(app, port, () => console.log(`Server is listening on port ${port}...`));

integration/tests/db-jwt.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { appConfigs } from '../presets';
55
import type { FakeUser } from '../testUtils';
66
import { createTestUtils } from '../testUtils';
77

8-
test.describe('Dev Browser JWT test', () => {
8+
test.describe('Dev browser test', () => {
99
const configs = [];
1010

1111
configs.forEach(config => {
@@ -50,7 +50,7 @@ test.describe('Dev Browser JWT test', () => {
5050
await u.po.expect.toBeSignedIn();
5151
});
5252

53-
test('Dev Browser JWT that gets appended to the URL when redirecting to Accounts Portal, overrides any existing Dev Browser JWT in AP', async () => {
53+
test('Dev browser ID that gets appended to the URL when redirecting to Accounts Portal, overrides any existing dev browser in AP', async () => {
5454
// TODO: Implement this test
5555
});
5656

@@ -65,7 +65,7 @@ test.describe('Dev Browser JWT test', () => {
6565
- Sign in with email and password
6666
- Should be redirected back to localhost and are signed in
6767
*/
68-
test('Deleting localhost Dev Browser JWT should clear the signed in state in Accounts Portal when redirected', async () => {
68+
test('Deleting localhost dev browser should clear the signed in state in Accounts Portal when redirected', async () => {
6969
// TODO: Implement this test
7070
});
7171

integration/tests/express/basic.test.ts

Lines changed: 0 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -50,40 +50,4 @@ testAgainstRunningApps({ withEnv: [appConfigs.envs.withEmailCodes] })('basic tes
5050
expect(res.status()).toBe(401);
5151
expect(await res.text()).toBe('Unauthorized');
5252
});
53-
54-
test('authenticates protected routes when user is signed in using legacy req.auth approach', async ({
55-
page,
56-
context,
57-
}) => {
58-
const u = createTestUtils({ app, page, context });
59-
await u.page.goToRelative('/');
60-
61-
await u.po.signIn.waitForMounted();
62-
await u.po.signIn.setIdentifier(fakeUser.email);
63-
await u.po.signIn.continue();
64-
await u.po.signIn.setPassword(fakeUser.password);
65-
await u.po.signIn.continue();
66-
67-
await u.po.userButton.waitForMounted();
68-
69-
const url = new URL('/api/legacy/protected', app.serverUrl);
70-
const res = await u.page.request.get(url.toString());
71-
expect(res.status()).toBe(200);
72-
expect(await res.text()).toBe('Protected API response');
73-
});
74-
75-
test('rejects protected routes when user is not authenticated using legacy req.auth approach', async ({
76-
page,
77-
context,
78-
}) => {
79-
const u = createTestUtils({ app, page, context });
80-
await u.page.goToRelative('/');
81-
82-
await u.po.signIn.waitForMounted();
83-
84-
const url = new URL('/api/legacy/protected', app.serverUrl);
85-
const res = await u.page.request.get(url.toString());
86-
expect(res.status()).toBe(401);
87-
expect(await res.text()).toBe('Unauthorized');
88-
});
8953
});

0 commit comments

Comments
 (0)