diff --git a/.changeset/mean-apples-approve.md b/.changeset/mean-apples-approve.md new file mode 100644 index 0000000000..776b846ba5 --- /dev/null +++ b/.changeset/mean-apples-approve.md @@ -0,0 +1,5 @@ +--- +'@clerk/clerk-js': patch +--- + +Bug fix: Being able to revoke a session from UserProfile. diff --git a/packages/clerk-js/src/ui/components/UserProfile/ActiveDevicesSection.tsx b/packages/clerk-js/src/ui/components/UserProfile/ActiveDevicesSection.tsx index 5d0f238163..d13aa8a5b3 100644 --- a/packages/clerk-js/src/ui/components/UserProfile/ActiveDevicesSection.tsx +++ b/packages/clerk-js/src/ui/components/UserProfile/ActiveDevicesSection.tsx @@ -48,7 +48,7 @@ export const ActiveDevicesSection = () => { const DeviceItem = ({ session }: { session: SessionWithActivitiesResource }) => { const isCurrent = useSession().session?.id === session.id; const status = useLoadingStatus(); - const [revokeSession] = useReverification(session.revoke); + const [revokeSession] = useReverification(session.revoke.bind(session)); const revoke = async () => { if (isCurrent || !session) { diff --git a/packages/clerk-js/src/ui/components/UserProfile/__tests__/SecurityPage.test.tsx b/packages/clerk-js/src/ui/components/UserProfile/__tests__/SecurityPage.test.tsx index f4c8ed948b..384ef6f22b 100644 --- a/packages/clerk-js/src/ui/components/UserProfile/__tests__/SecurityPage.test.tsx +++ b/packages/clerk-js/src/ui/components/UserProfile/__tests__/SecurityPage.test.tsx @@ -113,6 +113,7 @@ describe('SecurityPage', () => { isMobile: false, }, actor: null, + revoke: jest.fn().mockResolvedValue({}), } as any as SessionWithActivitiesResource, { pathRoot: '/me/sessions', @@ -131,6 +132,7 @@ describe('SecurityPage', () => { isMobile: false, }, actor: null, + revoke: jest.fn().mockResolvedValue({}), } as any as SessionWithActivitiesResource, ]), );