Skip to content

Commit

Permalink
fix(clerk-js): Persist "this" when revoking a session, from UserProfi…
Browse files Browse the repository at this point in the history
…le (#4653)
  • Loading branch information
panteliselef authored Nov 25, 2024
1 parent 2d3866c commit b85c5d7
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/mean-apples-approve.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@clerk/clerk-js': patch
---

Bug fix: Being able to revoke a session from UserProfile.
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ describe('SecurityPage', () => {
isMobile: false,
},
actor: null,
revoke: jest.fn().mockResolvedValue({}),
} as any as SessionWithActivitiesResource,
{
pathRoot: '/me/sessions',
Expand All @@ -131,6 +132,7 @@ describe('SecurityPage', () => {
isMobile: false,
},
actor: null,
revoke: jest.fn().mockResolvedValue({}),
} as any as SessionWithActivitiesResource,
]),
);
Expand Down

0 comments on commit b85c5d7

Please sign in to comment.