nvh95 / react-linkedin-login-oauth2

Easily get Authorization Code from Linked In to log in without redirecting.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

onSuccess is called twice

iners-max opened this issue · comments

When I get the authorization code from the onSuccess callback, I will try to retrieve an access token from LinkedIn. However, I found that the onSuccess callback is always called twice with the same authorization code. It will trigger my function to LinkedIn twice causing LinkedIn to return an error saying my authorization code is expired in the second call.

Is it intented?

Same for me

i am having same issue plz help

By any chance the component hosting the hook is getting rendered twice? or can you provide some more context on the usage?

I had the same issue in development due to <React.StrictMode>
Removed them and the issue is gone.

Same issue coming for me!
Strict mode didn't solve the issue, still being called twice!