popup window appears and dissapears in a split second
MeryAmun opened this issue · 0 comments
MeryAmun commented
When I click on login with LinkedIn image, popup window appears and dissappears within a split second. how can i ssolve this please?
Thanks
export const LinkedInLogin = () => {
const { linkedInLogin } = useLinkedIn({
clientId:"my-client-id",
redirectUri: ${window.location.origin}/oauth/complete/linkedin-oauth2
,
scope: "profile email",
state: "linkedin_page",
onSuccess: (code) => {
console.log(code);
setCode(code);
},
onFailure: (error) => {
console.log(error);
setErrorMessage(error.errorMessage);
},
});
const [code, setCode] = React.useState("");
const [errorMessage, setErrorMessage] = React.useState("");
return (
<img
onClick={linkedInLogin}
src={linkedin}
alt="Log in with Linked In"
style={{ maxWidth: "180px" }}
/>
{!code && <div>No code</div>}
{code && <div>Code: {code}</div>}
{errorMessage && <div>{errorMessage}</div>}
</div>