Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

popup window appears and dissapears in a split second #96

Open
MeryAmun opened this issue Feb 6, 2024 · 0 comments
Open

popup window appears and dissapears in a split second #96

MeryAmun opened this issue Feb 6, 2024 · 0 comments

Comments

@MeryAmun
Copy link

MeryAmun commented Feb 6, 2024

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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant