javascript

Official Javascript repository for Clerk authentication

MIT License

Downloads
6.1M
Stars
1.1K
Committers
167
javascript - @clerk/[email protected]

Published by clerk-cookie 10 months ago

Patch Changes

javascript - [email protected]

Published by clerk-cookie 10 months ago

Patch Changes

javascript - @clerk/[email protected]

Published by clerk-cookie 10 months ago

Patch Changes

javascript - @clerk/[email protected]

Published by clerk-cookie 10 months ago

Patch Changes

javascript - @clerk/[email protected]

Published by clerk-cookie 10 months ago

Patch Changes

javascript - @clerk/[email protected]

Published by clerk-cookie 10 months ago

Patch Changes

javascript - @clerk/[email protected]

Published by clerk-cookie 10 months ago

Patch Changes

  • 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]:

javascript - @clerk/[email protected]

Published by clerk-cookie 10 months ago

Patch Changes

  • Disable telemetry collection when window.navigator.webdriver is defined, indicating traffic from an automation tool. (#2448) by @BRKalow
javascript - @clerk/[email protected]

Published by clerk-cookie 10 months ago

Patch Changes

javascript - @clerk/[email protected]

Published by clerk-cookie 10 months ago

Patch Changes

  • 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]:

javascript - @clerk/[email protected]

Published by clerk-cookie 10 months ago

Patch Changes

  • 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.

    1. Protect a route that requires authentication

    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();
    });
    

    2. Protect a route that requires specific permissions

    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();
    });
    

    2. Manually redirect to sign-in URL using the redirectToSignIn helper

    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]:

javascript - @clerk/[email protected]

Published by clerk-cookie 10 months ago

Patch Changes

javascript - @clerk/[email protected]

Published by clerk-cookie 10 months ago

Patch Changes

javascript - [email protected]

Published by clerk-cookie 10 months ago

Patch Changes

javascript - @clerk/[email protected]

Published by clerk-cookie 10 months ago

Patch Changes

javascript - @clerk/[email protected]

Published by clerk-cookie 10 months ago

Patch Changes

javascript - @clerk/[email protected]

Published by clerk-cookie 10 months ago

Patch Changes

javascript - @clerk/[email protected]

Published by clerk-cookie 10 months ago

Patch Changes

javascript - @clerk/[email protected]

Published by clerk-cookie 10 months ago

Patch Changes

javascript - @clerk/[email protected]

Published by clerk-cookie 10 months ago

Minor Changes

  • Use both __clerk_db_jwt and __dev_browser search params to sync dev browser between application and Account Portal in development instances. (#2431) by @dimkl

    This change is required to support the next major version of the ClerkJS.