Repository navigation
Release 1.1.0
Added the clearAuthData() function to the useWristbandAuth() hook:
- The
clearAuthData()function permanently clears all client-side auth state, session data, and token data. You can optionally use this when you need to completely reset the SDK state, typically for testing, error recovery, or when implementing custom logout flows. Note that this only clears React state and does not invalidate session cookies nor redirect the user. For standard logout, redirect to your server's Logout Endpoint instead.
import { redirectToLogin, useWristbandAuth } from '@wristband/react-client-auth';
function ClearAuth() {
const { clearAuthData } = useWristbandAuth();
const reauthenticate = () => {
clearAuthData();
redirectToLogin('https://your-server.com/api/auth/login');
};
return (
<div>
<h2>Clear Authentication Data</h2>
<button onClick={() => reauthenticate()}>
Re-Authenticate
</button>
</div>
);
}
Added the useWristbandToken() hook:
- Refer to the README section to learn more