nvh95 / react-linkedin-login-oauth2

Easily get Authorization Code from Linked In to log in without redirecting.
MIT License
94 stars 49 forks source link

onSuccess is called twice #75

Open iners-max opened 2 years ago

iners-max commented 2 years ago

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?

raoularavel commented 1 year ago

Same for me

tripathiaakasah commented 1 year ago

i am having same issue plz help

mamankhan99 commented 1 year ago

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

kallsbo commented 1 year ago

I had the same issue in development due to Removed them and the issue is gone.

pasindu1997 commented 1 year ago

@kallsbo Thanks, This works

ayushsanjtgs commented 1 year ago

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

gauravp-dev commented 1 year ago

Removing works but how onSuccess is getting triggered second time and there should be some solution for this

gauravp-dev commented 1 year ago

I am having same is there any solution to that apart from removing StrictMode

Tobi-davies commented 1 week ago

I am having same is there any solution to that apart from removing StrictMode

Good day @gauravp-dev , did you get a solution to this? I am currently experiencing the same issue