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 11 months ago

Patch Changes

javascript - @clerk/[email protected]

Published by clerk-cookie 11 months ago

Minor Changes

  • Introduce Protect for authorization. (#2309) by @panteliselef

    Changes in public APIs:

    • Rename Gate to Protect
    • Support for permission checks. (Previously only roles could be used)
    • Remove the experimental tags and prefixes
    • Drop some from the has utility and Protect. Protect now accepts a condition prop where a function is expected with the has being exposed as the param.
    • Protect can now be used without required props. In this case behaves as <SignedIn>, if no authorization props are passed.
    • has will throw an error if neither permission or role is passed.
    • auth().protect() for Nextjs App Router. Allow per page protection in app router. This utility will automatically throw a 404 error if user is not authorized or authenticated.
      • inside a page or layout file it will render the nearest not-found component set by the developer
      • inside a route handler it will return empty response body with a 404 status code

Patch Changes

javascript - @clerk/[email protected]

Published by clerk-cookie 11 months ago

Minor Changes

  • Introduce Protect for authorization. (#2309) by @panteliselef

    Changes in public APIs:

    • Rename Gate to Protect
    • Support for permission checks. (Previously only roles could be used)
    • Remove the experimental tags and prefixes
    • Drop some from the has utility and Protect. Protect now accepts a condition prop where a function is expected with the has being exposed as the param.
    • Protect can now be used without required props. In this case behaves as <SignedIn>, if no authorization props are passed.
    • has will throw an error if neither permission or role is passed.
    • auth().protect() for Nextjs App Router. Allow per page protection in app router. This utility will automatically throw a 404 error if user is not authorized or authenticated.
      • inside a page or layout file it will render the nearest not-found component set by the developer
      • inside a route handler it will return empty response body with a 404 status code

Patch Changes

javascript - @clerk/[email protected]

Published by clerk-cookie 11 months ago

Patch Changes

javascript - [email protected]

Published by clerk-cookie 11 months ago

Patch Changes

javascript - @clerk/[email protected]

Published by clerk-cookie 11 months ago

Patch Changes

javascript - @clerk/[email protected]

Published by clerk-cookie 11 months ago

Patch Changes

javascript - @clerk/[email protected]

Published by clerk-cookie 11 months ago

Minor Changes

  • Introduce Protect for authorization. (#2309) by @panteliselef

    Changes in public APIs:

    • Rename Gate to Protect
    • Support for permission checks. (Previously only roles could be used)
    • Remove the experimental tags and prefixes
    • Drop some from the has utility and Protect. Protect now accepts a condition prop where a function is expected with the has being exposed as the param.
    • Protect can now be used without required props. In this case behaves as <SignedIn>, if no authorization props are passed.
    • has will throw an error if neither permission or role is passed.
    • auth().protect() for Nextjs App Router. Allow per page protection in app router. This utility will automatically throw a 404 error if user is not authorized or authenticated.
      • inside a page or layout file it will render the nearest not-found component set by the developer
      • inside a route handler it will return empty response body with a 404 status code

Patch Changes

javascript - @clerk/[email protected]

Published by clerk-cookie 11 months ago

Minor Changes

  • Introduce Protect for authorization. (#2309) by @panteliselef

    Changes in public APIs:

    • Rename Gate to Protect
    • Support for permission checks. (Previously only roles could be used)
    • Remove the experimental tags and prefixes
    • Drop some from the has utility and Protect. Protect now accepts a condition prop where a function is expected with the has being exposed as the param.
    • Protect can now be used without required props. In this case behaves as <SignedIn>, if no authorization props are passed.
    • has will throw an error if neither permission or role is passed.
    • auth().protect() for Nextjs App Router. Allow per page protection in app router. This utility will automatically throw a 404 error if user is not authorized or authenticated.
      • inside a page or layout file it will render the nearest not-found component set by the developer
      • inside a route handler it will return empty response body with a 404 status code

Patch Changes

javascript - @clerk/[email protected]

Published by clerk-cookie 11 months ago

Minor Changes

  • Introduce Protect for authorization. (#2309) by @panteliselef

    Changes in public APIs:

    • Rename Gate to Protect
    • Support for permission checks. (Previously only roles could be used)
    • Remove the experimental tags and prefixes
    • Drop some from the has utility and Protect. Protect now accepts a condition prop where a function is expected with the has being exposed as the param.
    • Protect can now be used without required props. In this case behaves as <SignedIn>, if no authorization props are passed.
    • has will throw an error if neither permission or role is passed.
    • auth().protect() for Nextjs App Router. Allow per page protection in app router. This utility will automatically throw a 404 error if user is not authorized or authenticated.
      • inside a page or layout file it will render the nearest not-found component set by the developer
      • inside a route handler it will return empty response body with a 404 status code

Patch Changes

javascript - @clerk/[email protected]

Published by clerk-cookie 11 months ago

Patch Changes

  • Use dynamic imports in <ClerkProvider /> which you import from @clerk/nextjs. (#2292) by @LekoArts

    Users on Next.js 12 and older can run into errors like these:

    error - ./node_modules/@clerk/nextjs/dist/esm/app-router/client/ClerkProvider.js:10:22
    Module not found: Can't resolve 'next/navigation'
    

    The aforementioned <ClerkProvider /> component contains code for both Next.js 12 (+ older) and Next.js 13 (+ newer). On older versions it can't find the imports only available in newer versions.

    If you're seeing these errors, you have to do two things:

    1. Update @clerk/nextjs to this version

    2. Update your next.config.js to ignore these imports:

      const webpack = require('webpack');
      
      /** @type {import('next').NextConfig} */
      const nextConfig = {
        reactStrictMode: true,
        webpack(config) {
          config.plugins.push(
            new webpack.IgnorePlugin({ resourceRegExp: /^next\/(navigation|headers|compat\/router)$/ }),
          );
          return config;
        },
      };
      
      module.exports = nextConfig;
      

      It is safe to ignore these modules as your Next.js 12 app won't hit these code paths.

javascript - @clerk/[email protected]

Published by clerk-cookie 11 months ago

Minor Changes

  • Deprecate Clerk.isReady() in favor of Clerk.loaded (#2293) by @dimkl
javascript - @clerk/[email protected]

Published by clerk-cookie 11 months ago

Patch Changes

javascript - @clerk/[email protected]

Published by clerk-cookie 11 months ago

Minor Changes

  • Deprecate Clerk.isReady() in favor of Clerk.loaded (#2293) by @dimkl

Patch Changes

javascript - @clerk/[email protected]

Published by clerk-cookie 11 months ago

Patch Changes

javascript - @clerk/[email protected]

Published by clerk-cookie 11 months ago

Patch Changes

javascript - @clerk/[email protected]

Published by clerk-cookie 11 months ago

Patch Changes

javascript - [email protected]

Published by clerk-cookie 11 months ago

Patch Changes

javascript - @clerk/[email protected]

Published by clerk-cookie 11 months ago

Patch Changes