Skip to content

@clerk/[email protected]

Pre-release
Pre-release
Compare
Choose a tag to compare
@clerk-cookie clerk-cookie released this 17 Jan 02:12
· 1687 commits to main since this release
e911301

Major Changes

  • Replace return the value of the following jwt helpers to match the format of backend API client return values (for consistency). (#2596) by @dimkl

    import { signJwt } from '@clerk/backend/jwt';
    
    - const { data, error } = await signJwt(...);
    + const { data, errors: [error] = [] } = await signJwt(...);
    import { verifyJwt } from '@clerk/backend/jwt';
    
    - const { data, error } = await verifyJwt(...);
    + const { data, errors: [error] = [] } = await verifyJwt(...);
    import { hasValidSignature } from '@clerk/backend/jwt';
    
    - const { data, error } = await hasValidSignature(...);
    + const { data, errors: [error] = [] } = await hasValidSignature(...);
    import { decodeJwt } from '@clerk/backend/jwt';
    
    - const { data, error } = await decodeJwt(...);
    + const { data, errors: [error] = [] } = await decodeJwt(...);
    import { verifyToken } from '@clerk/backend';
    
    - const { data, error } = await verifyToken(...);
    + const { data, errors: [error] = [] } = await verifyToken(...);

Patch Changes

    • Export ClerkMiddlewareAuthObject, ClerkMiddlewareAuth and ClerkMiddlewareOptions types (#2611) by @nikosdouvlis

    • Introduce auth().redirectToSignIn() that can be used in API routes and pages, eg

    import { auth } from '@clerk/nextjs/server';
    
    export const Layout = ({ children }) => {
      const { userId } = auth();
    
      if (!userId) {
        return auth().redirectToSignIn();
      }
    
      return <>{children}</>;
    };
  • Update @clerk/nextjs error messages to refer to clerkMiddleware() and deprecated authMiddleware() and fix a typo in cannotRenderSignUpComponentWhenSessionExists error message. (#2589) by @dimkl

  • Updated dependencies [3a2f13604, 9e99eb727, 6fffd3b54]: