Official Javascript repository for Clerk authentication
MIT License
Published by clerk-cookie 10 months ago
df40705d3
, 98f8ec629
, 4d5cae209
]:
Published by clerk-cookie 10 months ago
Remove MemberRole TypeMemberRole
would always include the old role keys admin
, member
, guest_member
. (#2388) by @panteliselef
If developers still depend on them after the introduction of custom roles, the can provide them as their custom types for authorization.
// clerk.d.ts
export {};
interface ClerkAuthorization {
permission: '';
role: 'admin' | 'basic_member' | 'guest_member';
}
Update @clerk/clerk-js
and @clerk/clerk-react
to support the following examples: (#2412) by @dimkl
Clerk.signOut({ redirectUrl: '/' })
<SignOutButton redirectUrl='/' />
// uses Clerk.signOut({ redirectUrl: '/' })
<UserButton afterSignOutUrl='/after' />
// uses Clerk.signOut({ redirectUrl: '/after' })
<ClerkProvider afterSignOutUrl='/after' />
// uses Clerk.signOut({ redirectUrl: '/after' })
Published by clerk-cookie 10 months ago
Path-based routing is now the default routing strategy if the path
prop is filled. Additionally, if the path
and routing
props are not filled, an error will be thrown. (#2338) by @octoper
// Without path or routing props, an error with be thrown
<UserProfile />
<CreateOrganization />
<OrganizationProfile />
<SignIn />
<SignUp />
// Alternative #1
<UserProfile path="/whatever"/>
<CreateOrganization path="/whatever"/>
<OrganizationProfile path="/whatever"/>
<SignIn path="/whatever"/>
<SignUp path="/whatever"/>
// Alternative #2
<UserProfile routing="hash_or_virtual"/>
<CreateOrganization routing="hash_or_virtual"/>
<OrganizationProfile routing="hash_or_virtual"/>
<SignIn routing="hash_or_virtual"/>
<SignUp routing="hash_or_virtual"/>
f4f99f18d
, cfea3d9c0
, fe2607b6f
, bad4de1a2
, 2e4a43017
, f5fb63cf1
, e7e2a1eae
]:
Published by clerk-cookie 10 months ago
f4f99f18d
, bad4de1a2
, e7e2a1eae
]:
Published by clerk-cookie 10 months ago
Path-based routing is now the default routing strategy if the path
prop is filled. Additionally, if the path
and routing
props are not filled, an error will be thrown. (#2338) by @octoper
// Without path or routing props, an error with be thrown
<UserProfile />
<CreateOrganization />
<OrganizationProfile />
<SignIn />
<SignUp />
// Alternative #1
<UserProfile path="/whatever"/>
<CreateOrganization path="/whatever"/>
<OrganizationProfile path="/whatever"/>
<SignIn path="/whatever"/>
<SignUp path="/whatever"/>
// Alternative #2
<UserProfile routing="hash_or_virtual"/>
<CreateOrganization routing="hash_or_virtual"/>
<OrganizationProfile routing="hash_or_virtual"/>
<SignIn routing="hash_or_virtual"/>
<SignUp routing="hash_or_virtual"/>
f4f99f18d
, cfea3d9c0
, fe2607b6f
, bad4de1a2
, 2e4a43017
, f5fb63cf1
, e7e2a1eae
]:
Published by clerk-cookie 10 months ago
cfea3d9c0
, d18cae5fd
, 394cecc6b
, fe2607b6f
, 2e4a43017
, f5fb63cf1
, bf09d18d6
]:
Published by clerk-cookie 10 months ago
Path-based routing is now the default routing strategy if the path
prop is filled. Additionally, if the path
and routing
props are not filled, an error will be thrown. (#2338) by @octoper
// Without path or routing props, an error with be thrown
<UserProfile />
<CreateOrganization />
<OrganizationProfile />
<SignIn />
<SignUp />
// Alternative #1
<UserProfile path="/whatever"/>
<CreateOrganization path="/whatever"/>
<OrganizationProfile path="/whatever"/>
<SignIn path="/whatever"/>
<SignUp path="/whatever"/>
// Alternative #2
<UserProfile routing="hash_or_virtual"/>
<CreateOrganization routing="hash_or_virtual"/>
<OrganizationProfile routing="hash_or_virtual"/>
<SignIn routing="hash_or_virtual"/>
<SignUp routing="hash_or_virtual"/>
Consolidate afterSignOutOneUrl
& afterSignOutAllUrl
to afterSignOutUrl
and drop usage of Dashboard settings in ClerkJS components. The Dashboard settings should only apply to the Account Portal application. (#2414) by @dimkl
Remove MemberRole TypeMemberRole
would always include the old role keys admin
, member
, guest_member
. (#2388) by @panteliselef
If developers still depend on them after the introduction of custom roles, the can provide them as their custom types for authorization.
// clerk.d.ts
export {};
interface ClerkAuthorization {
permission: '';
role: 'admin' | 'basic_member' | 'guest_member';
}
Update @clerk/clerk-js
and @clerk/clerk-react
to support the following examples: (#2412) by @dimkl
Clerk.signOut({ redirectUrl: '/' })
<SignOutButton redirectUrl='/' />
// uses Clerk.signOut({ redirectUrl: '/' })
<UserButton afterSignOutUrl='/after' />
// uses Clerk.signOut({ redirectUrl: '/after' })
<ClerkProvider afterSignOutUrl='/after' />
// uses Clerk.signOut({ redirectUrl: '/after' })
fe2607b6f
, 2e4a43017
]:
Published by clerk-cookie 10 months ago
f4f99f18d
, fe2607b6f
, bad4de1a2
, 2e4a43017
, e7e2a1eae
]:
Published by clerk-cookie 10 months ago
f4f99f18d
, cfea3d9c0
, fe2607b6f
, bad4de1a2
, 2e4a43017
, f5fb63cf1
, e7e2a1eae
]:
Published by clerk-cookie 10 months ago
Path-based routing is now the default routing strategy if the path
prop is filled. Additionally, if the path
and routing
props are not filled, an error will be thrown. (#2338) by @octoper
// Without path or routing props, an error with be thrown
<UserProfile />
<CreateOrganization />
<OrganizationProfile />
<SignIn />
<SignUp />
// Alternative #1
<UserProfile path="/whatever"/>
<CreateOrganization path="/whatever"/>
<OrganizationProfile path="/whatever"/>
<SignIn path="/whatever"/>
<SignUp path="/whatever"/>
// Alternative #2
<UserProfile routing="hash_or_virtual"/>
<CreateOrganization routing="hash_or_virtual"/>
<OrganizationProfile routing="hash_or_virtual"/>
<SignIn routing="hash_or_virtual"/>
<SignUp routing="hash_or_virtual"/>
Make the user name on clickable, i.e. part of the button's trigger. (#2411) by @marcelscruz
This change inverts the positions of cl-userButtonTrigger
and cl-userButtonBox
, the latter now being a child of the former.
Consolidate afterSignOutOneUrl
& afterSignOutAllUrl
to afterSignOutUrl
and drop usage of Dashboard settings in ClerkJS components. The Dashboard settings should only apply to the Account Portal application. (#2414) by @dimkl
Remove MemberRole TypeMemberRole
would always include the old role keys admin
, member
, guest_member
. (#2388) by @panteliselef
If developers still depend on them after the introduction of custom roles, the can provide them as their custom types for authorization.
// clerk.d.ts
export {};
interface ClerkAuthorization {
permission: '';
role: 'admin' | 'basic_member' | 'guest_member';
}
Update @clerk/clerk-js
and @clerk/clerk-react
to support the following examples: (#2412) by @dimkl
Clerk.signOut({ redirectUrl: '/' })
<SignOutButton redirectUrl='/' />
// uses Clerk.signOut({ redirectUrl: '/' })
<UserButton afterSignOutUrl='/after' />
// uses Clerk.signOut({ redirectUrl: '/after' })
<ClerkProvider afterSignOutUrl='/after' />
// uses Clerk.signOut({ redirectUrl: '/after' })
Prevent submitting on enter in Organization Profile form when submit button is disabled. (#2400) by @panteliselef
Bug fix: Clear feedback of input field if setError
is called with undefined. (#2399) by @panteliselef
Updated dependencies [fe2607b6f
, 2e4a43017
]:
Published by clerk-cookie 10 months ago
cfea3d9c0
, d18cae5fd
, 394cecc6b
, fe2607b6f
, 2e4a43017
, f5fb63cf1
, bf09d18d6
]:
Published by clerk-cookie 10 months ago
Add createOrganizationEnabled
param in @clerk/backend
method User.updateUser()
(#2415) by @dimkl
Example:
import { createClerkClient } from '@clerk/backend';
const clerkClient = createClerkClient({...});
await clerkClient.users.updateUser('user_...', { createOrganizationEnabled: true })
OrganizationMembershipRole
should respect authorization types provided by the developer if those exist. (#2408) by @panteliselef
Fixed an issue where errors returned from backend api requests are not converted to camelCase. (#2423) by @Nikpolik
Published by clerk-cookie 10 months ago
Remove BuildUrlWithAuthParams
type (#2367) by @tmilewski
AuthConfigResource
no longer has a urlBasedSessionSyncing
property
buildUrlWithAuth
no longer accepts an options
argument of BuildUrlWithAuthParams
.
Remove hashing and third-party cookie functionality related to development instance session syncing in favor of URL-based session syncing with query parameters. (#2367) by @tmilewski
Change return values of signJwt
, hasValidSignature
, decodeJwt
, verifyJwt
(#2377) by @dimkl
to return { data, error }
. Example of keeping the same behavior using those utilities:
import { signJwt, hasValidSignature, decodeJwt, verifyJwt } from '@clerk/backend/jwt';
const { data, error } = await signJwt(...)
if (error) throw error;
const { data, error } = await hasValidSignature(...)
if (error) throw error;
const { data, error } = decodeJwt(...)
if (error) throw error;
const { data, error } = await verifyJwt(...)
if (error) throw error;
Published by clerk-cookie 10 months ago
Replace the signOutCallback
prop on the <SignOutButton />
with redirectUrl
. This aligns the API surface with other UI components provided by @clerk/clerk-react
. (#2348) by @LekoArts
If you previously used the signOutCallback
prop to navigate to another page, you can migrate as shown below.
Before:
import { SignOutButton } from '@clerk/clerk-react';
export const Signout = () => {
return (
<SignOutButton
signOutCallback={() => {
window.location.href = '/your-path';
}}
>
<button>Sign Out</button>
</SignOutButton>
);
};
After:
import { SignOutButton } from '@clerk/clerk-react';
export const Signout = () => {
return (
<SignOutButton redirectUrl='/your-path'>
<button>Sign Out</button>
</SignOutButton>
);
};
Remove hashing and third-party cookie functionality related to development instance session syncing in favor of URL-based session syncing with query parameters. (#2367) by @tmilewski
buildUrlWithAuth
no longer accepts an options
argument. (#2367) by @tmilewski
5f58a2274
, a9fe242be
, 5f58a2274
, a9fe242be
]:
Published by clerk-cookie 10 months ago
Remove hashing and third-party cookie functionality related to development instance session syncing in favor of URL-based session syncing with query parameters. (#2367) by @tmilewski
Change return values of signJwt
, hasValidSignature
, decodeJwt
, verifyJwt
(#2377) by @dimkl
to return { data, error }
. Example of keeping the same behavior using those utilities:
import { signJwt, hasValidSignature, decodeJwt, verifyJwt } from '@clerk/backend/jwt';
const { data, error } = await signJwt(...)
if (error) throw error;
const { data, error } = await hasValidSignature(...)
if (error) throw error;
const { data, error } = decodeJwt(...)
if (error) throw error;
const { data, error } = await verifyJwt(...)
if (error) throw error;
Changes in exports of @clerk/backend
: (#2363) by @dimkl
@clerk/backend/internal
:
import {
AuthStatus,
buildRequestUrl,
constants,
createAuthenticateRequest,
createIsomorphicRequest,
debugRequestState,
makeAuthObjectSerializable,
prunePrivateMetadata,
redirect,
sanitizeAuthObject,
signedInAuthObject,
signedOutAuthObject,
} from '@clerk/backend/internal';
// Before
import { AuthStatus, ... } from '@clerk/backend';
// After
import { AuthStatus, ... } from '@clerk/backend/internal';
Dropping those exports results in also dropping the exports from gatsby-plugin-clerk
, @clerk/clerk-sdk-node
, @clerk/backend
, @clerk/fastify
, @clerk/nextjs
, @clerk/remix
packages.Changes in exports of @clerk/backend
: (#2365) by @dimkl
// Before
import {
AllowlistIdentifier,
Client,
DeletedObject,
Email,
EmailAddress,
ExternalAccount,
IdentificationLink,
Invitation,
OauthAccessToken,
ObjectType,
Organization,
OrganizationInvitation,
OrganizationMembership,
OrganizationMembershipPublicUserData,
PhoneNumber,
RedirectUrl,
SMSMessage,
Session,
SignInToken,
Token,
User,
Verification,
} from '@clerk/backend';
// After : no alternative since there is no need to use those classes
Dropping those exports results in also dropping the exports from gatsby-plugin-clerk
, @clerk/clerk-sdk-node
, @clerk/backend
, @clerk/fastify
, @clerk/nextjs
, @clerk/remix
packages.import type { Organization, Session, User, WebhookEvent, WebhookEventType } from '@clerk/backend';
Changes in exports of @clerk/backend
: (#2364) by @dimkl
@clerk/backend/jwt
:
import { decodeJwt, hasValidSignature, signJwt, verifyJwt } from '@clerk/backend/jwt';
// Before
import { decodeJwt, ... } from '@clerk/backend';
// After
import { decodeJwt, ... } from '@clerk/backend/jwt';
Dropping those exports results in also dropping the exports from gatsby-plugin-clerk
, @clerk/clerk-sdk-node
, @clerk/backend
, @clerk/fastify
, @clerk/nextjs
, @clerk/remix
packages.Changes in @clerk/backend
exports: (#2362) by @dimkl
deserialize
helper/errors
subpath export, eg:
import {
TokenVerificationError,
TokenVerificationErrorAction,
TokenVerificationErrorCode,
TokenVerificationErrorReason,
} from '@clerk/backend/errors';
// Before
import { TokenVerificationError, TokenVerificationErrorReason } from '@clerk/backend';
// After
import { TokenVerificationError, TokenVerificationErrorReason } from '@clerk/backend/errors';
Use NEXT_PUBLIC_CLERK_JS_URL
instead of NEXT_PUBLIC_CLERK_JS
to pin a specific @clerk/clerk-js version. (#2374) by @SokratisVidros
2a67f729d
, a9fe242be
, 1e98187b4
, d08ec6d8f
, 5f58a2274
, 5f58a2274
, a9fe242be
, 0ec3a146c
, 1ad910eb9
, f58a9949b
, 9b02c1aae
]:
Published by clerk-cookie 10 months ago
Published by clerk-cookie 10 months ago
Drop all pre-instantiated Backend API resources (allowlistIdentifiers
, clients
, emailAddresses
, emails
, invitations
, organizations
, phoneNumbers
, redirectUrls
, sessions
, signInTokens
, users
, domains
). Use the clerkClient
import instead. (#2362) by @dimkl
// Before
import { users } from '@clerk/clerk-sdk-node';
// After
import { clerkClient } from '@clerk/clerk-sdk-node';
clerkClient.users;
Changes in exports of @clerk/backend
: (#2363) by @dimkl
@clerk/backend/internal
:
import {
AuthStatus,
buildRequestUrl,
constants,
createAuthenticateRequest,
createIsomorphicRequest,
debugRequestState,
makeAuthObjectSerializable,
prunePrivateMetadata,
redirect,
sanitizeAuthObject,
signedInAuthObject,
signedOutAuthObject,
} from '@clerk/backend/internal';
// Before
import { AuthStatus, ... } from '@clerk/backend';
// After
import { AuthStatus, ... } from '@clerk/backend/internal';
Dropping those exports results in also dropping the exports from gatsby-plugin-clerk
, @clerk/clerk-sdk-node
, @clerk/backend
, @clerk/fastify
, @clerk/nextjs
, @clerk/remix
packages.Changes in exports of @clerk/backend
: (#2365) by @dimkl
// Before
import {
AllowlistIdentifier,
Client,
DeletedObject,
Email,
EmailAddress,
ExternalAccount,
IdentificationLink,
Invitation,
OauthAccessToken,
ObjectType,
Organization,
OrganizationInvitation,
OrganizationMembership,
OrganizationMembershipPublicUserData,
PhoneNumber,
RedirectUrl,
SMSMessage,
Session,
SignInToken,
Token,
User,
Verification,
} from '@clerk/backend';
// After : no alternative since there is no need to use those classes
Dropping those exports results in also dropping the exports from gatsby-plugin-clerk
, @clerk/clerk-sdk-node
, @clerk/backend
, @clerk/fastify
, @clerk/nextjs
, @clerk/remix
packages.import type { Organization, Session, User, WebhookEvent, WebhookEventType } from '@clerk/backend';
Changes in exports of @clerk/backend
: (#2364) by @dimkl
@clerk/backend/jwt
:
import { decodeJwt, hasValidSignature, signJwt, verifyJwt } from '@clerk/backend/jwt';
// Before
import { decodeJwt, ... } from '@clerk/backend';
// After
import { decodeJwt, ... } from '@clerk/backend/jwt';
Dropping those exports results in also dropping the exports from gatsby-plugin-clerk
, @clerk/clerk-sdk-node
, @clerk/backend
, @clerk/fastify
, @clerk/nextjs
, @clerk/remix
packages.Changes in @clerk/backend
exports: (#2362) by @dimkl
deserialize
helper/errors
subpath export, eg:
import {
TokenVerificationError,
TokenVerificationErrorAction,
TokenVerificationErrorCode,
TokenVerificationErrorReason,
} from '@clerk/backend/errors';
// Before
import { TokenVerificationError, TokenVerificationErrorReason } from '@clerk/backend';
// After
import { TokenVerificationError, TokenVerificationErrorReason } from '@clerk/backend/errors';
Clerk
in case of using default clerkClient from @clerk/clerk-sdk-node
without secretKey caused by replaced import. (#2368) by @dimkl
Published by clerk-cookie 10 months ago
Update @clerk/remix
's rootAuthLoader
and getAuth
helpers to handle handshake auth status, this replaces the previous interstitial flow. As a result of this, the ClerkErrorBoundary
is no longer necessary and has been removed. (#2380) by @BRKalow
To migrate, remove usage of ClerkErrorBoundary
:
- import { ClerkApp, ClerkErrorBoundary } from "@clerk/remix";
+ import { ClerkApp } from "@clerk/remix";
...
- export const ErrorBoundary = ClerkErrorBoundary();
Changes in exports of @clerk/backend
: (#2363) by @dimkl
@clerk/backend/internal
:
import {
AuthStatus,
buildRequestUrl,
constants,
createAuthenticateRequest,
createIsomorphicRequest,
debugRequestState,
makeAuthObjectSerializable,
prunePrivateMetadata,
redirect,
sanitizeAuthObject,
signedInAuthObject,
signedOutAuthObject,
} from '@clerk/backend/internal';
// Before
import { AuthStatus, ... } from '@clerk/backend';
// After
import { AuthStatus, ... } from '@clerk/backend/internal';
Dropping those exports results in also dropping the exports from gatsby-plugin-clerk
, @clerk/clerk-sdk-node
, @clerk/backend
, @clerk/fastify
, @clerk/nextjs
, @clerk/remix
packages.Changes in exports of @clerk/backend
: (#2365) by @dimkl
// Before
import {
AllowlistIdentifier,
Client,
DeletedObject,
Email,
EmailAddress,
ExternalAccount,
IdentificationLink,
Invitation,
OauthAccessToken,
ObjectType,
Organization,
OrganizationInvitation,
OrganizationMembership,
OrganizationMembershipPublicUserData,
PhoneNumber,
RedirectUrl,
SMSMessage,
Session,
SignInToken,
Token,
User,
Verification,
} from '@clerk/backend';
// After : no alternative since there is no need to use those classes
Dropping those exports results in also dropping the exports from gatsby-plugin-clerk
, @clerk/clerk-sdk-node
, @clerk/backend
, @clerk/fastify
, @clerk/nextjs
, @clerk/remix
packages.import type { Organization, Session, User, WebhookEvent, WebhookEventType } from '@clerk/backend';
2a67f729d
, a9fe242be
, 1e98187b4
, d08ec6d8f
, 5f58a2274
, 5f58a2274
, a9fe242be
, 0ec3a146c
, 1ad910eb9
, f58a9949b
, 9b02c1aae
]:
Published by clerk-cookie 10 months ago
Changes in exports of @clerk/backend
: (#2363) by @dimkl
@clerk/backend/internal
:
import {
AuthStatus,
buildRequestUrl,
constants,
createAuthenticateRequest,
createIsomorphicRequest,
debugRequestState,
makeAuthObjectSerializable,
prunePrivateMetadata,
redirect,
sanitizeAuthObject,
signedInAuthObject,
signedOutAuthObject,
} from '@clerk/backend/internal';
// Before
import { AuthStatus, ... } from '@clerk/backend';
// After
import { AuthStatus, ... } from '@clerk/backend/internal';
Dropping those exports results in also dropping the exports from gatsby-plugin-clerk
, @clerk/clerk-sdk-node
, @clerk/backend
, @clerk/fastify
, @clerk/nextjs
, @clerk/remix
packages.Changes in exports of @clerk/backend
: (#2365) by @dimkl
// Before
import {
AllowlistIdentifier,
Client,
DeletedObject,
Email,
EmailAddress,
ExternalAccount,
IdentificationLink,
Invitation,
OauthAccessToken,
ObjectType,
Organization,
OrganizationInvitation,
OrganizationMembership,
OrganizationMembershipPublicUserData,
PhoneNumber,
RedirectUrl,
SMSMessage,
Session,
SignInToken,
Token,
User,
Verification,
} from '@clerk/backend';
// After : no alternative since there is no need to use those classes
Dropping those exports results in also dropping the exports from gatsby-plugin-clerk
, @clerk/clerk-sdk-node
, @clerk/backend
, @clerk/fastify
, @clerk/nextjs
, @clerk/remix
packages.import type { Organization, Session, User, WebhookEvent, WebhookEventType } from '@clerk/backend';
Published by clerk-cookie 10 months ago
2a67f729d
, e7414cb3f
, 5f58a2274
, 5f58a2274
]: