import { useAuth } from '@broadleaf/auth-react';
const MyComponent = () => {
const { loginWithRedirect } = useAuth();
useEffect(() => {
loginWithRedirect({ accountId });
}, [accountId]);
return (
<button
onClick={() => {
loginWithRedirect({ accountId: 'someValue' });
}}
>
Change Account
</button>
);
}