Skip to content

Commit 2148b4d

Browse files
authored
Merge branch 'main' into sam/mobile-582-update-usesso-in-clerkexpoexperimental-to-use-new-hooks
2 parents 205771d + e16bd7f commit 2148b4d

848 files changed

Lines changed: 32625 additions & 7226 deletions

File tree

Some content is hidden

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

.changeset/brave-mammals-burn.md

Lines changed: 0 additions & 5 deletions
This file was deleted.

.changeset/calm-clients-recover.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@clerk/expo': patch
3+
---
4+
5+
Fix JS auth state recovery after rejecting a divergent native client so signed-in sessions can still sign out.

.changeset/configure-sso-modal-close-button-height.md

Lines changed: 0 additions & 5 deletions
This file was deleted.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@clerk/expo': patch
3+
---
4+
5+
Bump the bundled `clerk-android` SDK (`clerk-android-api` and `clerk-android-ui`) from `1.0.36` to `1.0.37`. See the Clerk Android release: https://github.com/clerk/clerk-android/releases/tag/v1.0.37.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@clerk/expo': patch
3+
---
4+
5+
Bump the bundled `clerk-ios` SDK from `1.3.4` to `1.3.5`. See the Clerk iOS release: https://github.com/clerk/clerk-ios/releases/tag/1.3.5.

.changeset/fix-touch-session-doc-link.md

Lines changed: 0 additions & 5 deletions
This file was deleted.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@clerk/nuxt': major
3+
---
4+
5+
Drop support for Nuxt 3, which reaches end-of-life on July 31, 2026. `@clerk/nuxt` now requires Nuxt 4, and the minimum supported Node.js version is now `^20.19.0 || >=22.12.0` to match Nuxt 4's own requirement. If you are still on Nuxt 3, follow the [Nuxt upgrade guide](https://nuxt.com/docs/getting-started/upgrade) to upgrade your project before updating `@clerk/nuxt`.
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
---
2+
'@clerk/nuxt': major
3+
---
4+
5+
Remove `createRouteMatcher` from `@clerk/nuxt/server` and the auto-imported client-side `createRouteMatcher`. Middleware-based auth checks rely on path matching, which can diverge from how requests are actually routed and leave protected resources reachable. Move auth checks into the resources themselves.
6+
7+
Protect API routes inside the event handler itself:
8+
9+
```ts
10+
export default defineEventHandler(event => {
11+
const { userId } = event.context.auth();
12+
13+
if (!userId) {
14+
throw createError({ statusCode: 401, statusMessage: 'Unauthorized' });
15+
}
16+
17+
return { userId };
18+
});
19+
```
20+
21+
Protect pages with a named route middleware and opt pages into it with `definePageMeta()`. Child routes inherit the middleware applied to their parent, so a single declaration can protect a whole section:
22+
23+
```ts
24+
// app/middleware/auth.ts
25+
export default defineNuxtRouteMiddleware(() => {
26+
const { isSignedIn } = useAuth();
27+
28+
if (!isSignedIn.value) {
29+
return navigateTo('/sign-in');
30+
}
31+
});
32+
```
33+
34+
```vue
35+
<script setup>
36+
definePageMeta({ middleware: 'auth' });
37+
</script>
38+
```
39+
40+
If you want to hand this work to a coding agent, use this migration prompt:
41+
42+
```md
43+
Migrate my Nuxt project away from Clerk's removed `createRouteMatcher` API.
44+
45+
1. Find every matcher created with `createRouteMatcher`, along with the logic
46+
that uses it (throwing 401 errors, calling `navigateTo('/sign-in')`, etc.).
47+
Matchers can appear in Nitro server middleware (imported from
48+
`@clerk/nuxt/server`) or in Nuxt route middleware (auto-imported).
49+
2. For every API route those matchers protected, move the auth check into the
50+
event handler itself:
51+
const { userId } = event.context.auth();
52+
if (!userId) throw createError({ statusCode: 401, statusMessage: 'Unauthorized' });
53+
Keep any role or permission checks (`event.context.auth().has(...)`) with
54+
the resource as well.
55+
3. For every page those matchers protected, create a named route middleware in
56+
`app/middleware/` that checks `useAuth()` and redirects with `navigateTo()`,
57+
then opt pages into it with `definePageMeta({ middleware: 'auth' })`. Child
58+
routes inherit the middleware applied to their parent.
59+
4. Remove the `createRouteMatcher` imports and calls. Keep `clerkMiddleware()`
60+
itself. Middleware logic unrelated to auth protection (headers, locale
61+
redirects, etc.) may stay, using plain `getRequestURL(event).pathname`
62+
checks. Plain pathname checks do not normalize percent-encoding
63+
(`/api/%61dmin` will not match a check for `/api/admin`), so never use
64+
them for auth or security decisions. Those belong on the resource itself,
65+
as in steps 2 and 3.
66+
5. Make sure every route previously covered by a matcher pattern (including
67+
glob patterns like `/dashboard(.*)`) now has its own check, then verify the
68+
project builds.
69+
```

.changeset/major-poets-refuse.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
---
2+
'@clerk/backend': minor
3+
---
4+
5+
Align the `EnterpriseConnection` response resource with what the Backend API actually returns:
6+
7+
- `EnterpriseConnection` now exposes `provider`, `logoPublicUrl`, `allowOrganizationAccountLinking`, `authenticatable`, `disableJitProvisioning`, and `customAttributes`.
8+
- `EnterpriseConnectionSamlConnection` now exposes `active`, `forceAuthn`, and `loginHint`.
9+
- `EnterpriseConnectionOauthConfig` now exposes `providerKey`, `authUrl`, `tokenUrl`, `userInfoUrl`, and `requiresPkce`.
10+
- Deprecated properties the Backend API never returns, which were always `undefined` despite their declared types: `allowSubdomains` on `EnterpriseConnection` (use `samlConnection.allowSubdomains`), and `idpMetadata` and `syncUserAttributes` on `EnterpriseConnectionSamlConnection` (use the top-level `syncUserAttributes`).
11+
- `organizationId` is now normalized to `null` when the Backend API omits it, matching its declared `string | null` type. Properties backed by optional API fields (for example `oauthConfig.clientId` and the SAML IdP fields) are now typed as possibly `undefined` to match runtime behavior.

.changeset/mosaic-avatar.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@clerk/ui': minor
3+
---
4+
5+
Add a new Mosaic `Avatar` compound component (StyleX). `Avatar.Root` owns `shape` (`circle` | `square`) and `size` (`lg` | `md` | `sm` | `xs`); compose `Avatar.Image` (renders once the image loads) and `Avatar.Fallback` (shown while the image is pending or has failed, with an optional `delayMs`) inside it.

0 commit comments

Comments
 (0)