nvh95/react-linkedin-login-oauth2

onSuccess/onFailure doesn't pass anything

galoberlyn opened this issue · 1 comments

I'm using react hooks and passing data to another function using onSuccess={myfunc} and onFailuire.

`const handleSuccess = (data) => {
console.log(data); //no passed data here
}

return(
<img alt="Log in with Linked In" style={{ maxWidth: '180px' }} />
)`

Another approach is to pass directly the function but still no luck.
<LinkedIn clientId={env.LINKEDIN_CLIENT_ID()} onFailure={(data) => {console.log(data)} } onSuccess={(data) => {console.log(data)} } scope="r_liteprofile r_emailaddress" redirectUri="http://localhost:3000/auth/linkedin" > <img alt="Log in with Linked In" style={{ maxWidth: '180px' }} /> </LinkedIn>

works fine in here https://www.npmjs.com/package/react-linkedin-oauth2

<Router> <Provider store={store}> <div> <Switch> <Route exact path="/" component={Login} /> <Route exact path="/auth/linkedin" component={LinkedInPopUp} /> </Switch> </div> </Provider> </Router>

Found the issue. I removed the div, now works fine.