B2B Saas Authentication

/

Frontend SDKs

/

Headless

/

Session Management

/

Revoke Sessions for Member

Revoke sessions for Member

Wraps Stytch's revoke Session endpoint and revokes all Sessions for a given Member.

import React, { useCallback } from 'react';
import { useStytchB2BClient } from '@stytch/react/b2b';

export const RevokeSessionsButton = () => {
  const stytch = useStytchB2BClient();

  const revokeSessions = useCallback(() => {
    stytch.session.revokeForMember({ member_id: 'member-test-32fc5024-9c09-4da3-bd2e-c9ce4da9375f' });
  }, [stytch]);

  return <button onClick={revokeSessions}>Revoke sessions</button>;
};

RESPONSE

200
{
  "status_code": 200,
  "request_id": "request-id-test-b05c992f-ebdc-489d-a754-c7e70ba13141"
}