Official Javascript repository for Clerk authentication
MIT License
Published by clerk-cookie 10 months ago
71b4b9ca2
, 65332d744
]:
Published by clerk-cookie 10 months ago
71b4b9ca2
]:
Published by clerk-cookie 10 months ago
71b4b9ca2
, 65332d744
]:
Published by clerk-cookie 10 months ago
Bug fix: Avoid triggering prepare verification twice. (Affects only dev mode) (#2458) by @panteliselef
Update user memberships when user creates, leaves or deletes an organization. (#2504) by @panteliselef
Bug fix: fetch custom roles in OrganizationSwitcher (#2450) by @panteliselef
Updated dependencies [65332d744
]:
Published by clerk-cookie 10 months ago
58094ca39
, bc4508d24
, 65332d744
, 04b6b1813
]:
Published by clerk-cookie 10 months ago
58094ca39
, bc4508d24
, 04b6b1813
]:
Published by clerk-cookie 10 months ago
Fixed a bug where backend API responses where missing error details. This was caused by parsing the errors twice once in the response error handling code and again when initializing the ClerkAPIResponseError. (#2421) by @Nikpolik
Updated dependencies [65332d744
]:
Published by clerk-cookie 10 months ago
Published by clerk-cookie 10 months ago
7ecd6f6ab
]:
Published by clerk-cookie 10 months ago
Integrate handshake handling into ClerkExpressWithAuth()
and ClerkExpressRequireWith()
. If the authenticateRequest()
returns a redirect or is in a handshake state, the middlewares will properly handle this and respond accordingly. (#2447) by @BRKalow
Updated dependencies [7ecd6f6ab
]:
Published by clerk-cookie 10 months ago
Introduce the new clerkMiddleware
helper to allow for more flexibility in how Clerk is integrated into your Next.js middleware. Example usage can be found below, for more details, For more details, please see the clerkMiddleware documentation. (#2404) by @nikosdouvlis
The clerkMiddleware
helper effectively replaces the older authMiddleware
helper, which is now considered deprecated and will be removed in the next major release.
import { clerkMiddleware } from '@clerk/nextjs/server';
export default clerkMiddleware(auth => {
const { userId } = auth().protect();
// userId is now available for use in your route handler
// for page requests, calling protect will automatically redirect the user to the sign-in URL if they are not authenticated
return NextResponse.next();
});
import { clerkMiddleware } from '@clerk/nextjs/server';
export default clerkMiddleware(auth => {
const { userId } = auth().protect({ permission: 'org:domains:delete' });
// userId is now available for use in your route handler
// for page requests, calling protect will automatically throw a notFound error if the user does not have the required permissions
return NextResponse.next();
});
import { clerkMiddleware } from '@clerk/nextjs/server';
export default clerkMiddleware(auth => {
// If you want more fine-grained control, you can always use the low-level redirectToSignIn helper
if (!auth().userId) {
return auth().redirectToSignIn();
}
return NextResponse.next();
});
This commit also introduces the experimental createRouteMatcher
helper, which can be used to create a route matcher that matches a route against the current request. This is useful for creating custom logic based on which routes you want to handle as protected or public.
import { clerkMiddleware, experimental_createRouteMatcher } from '@clerk/nextjs/server';
const isProtectedRoute = experimental_createRouteMatcher([/protected.*/]);
export default clerkMiddleware((auth, request) => {
if (isProtectedRoute(request)) {
auth().protect();
}
return NextResponse.next();
});
Updated dependencies [7ecd6f6ab
]:
Published by clerk-cookie 10 months ago
7ecd6f6ab
]:
Published by clerk-cookie 10 months ago
Published by clerk-cookie 10 months ago
b8266a091
]:
Published by clerk-cookie 10 months ago
7ecd6f6ab
]:
Published by clerk-cookie 10 months ago
23ebc89e9
, 7ecd6f6ab
, 9040549d6
]:
Published by clerk-cookie 10 months ago
Bug fix: Avoid triggering prepare verification twice. (Affects only dev mode) (#2459) by @panteliselef
Bug fix: fetch custom roles in OrganizationSwitcher (#2430) by @panteliselef
Updated dependencies [7ecd6f6ab
, 390a70732
]:
Published by clerk-cookie 10 months ago
7ecd6f6ab
]:
Published by clerk-cookie 10 months ago
23ebc89e9
, 7ecd6f6ab
, 9040549d6
]:
Published by clerk-cookie 10 months ago