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

Having issue with popup

abhiram5 opened this issue · comments

I just tried your react-linkedin-login-oauth2 through npm. I'm able to log in through linked in perfectly but after login, the redirect URL happening in the popup instead of the parent window.

I tried this.
``````

            <LinkedIn
                    clientId="xxxxxxxxxxxxxxxx"
                    redirectUri={`${`http://localhost:3004/#/login`}/linkedin`}
                    onFailure={this.handleFailure}
                    onSuccess={this.handleSuccess}
                  >
                   Login with linkedin
             </LinkedIn>

same here

This should help you:
https://stackoverflow.com/questions/43209666/react-router-v4-cannot-get-url

Go to your webpack.config.js file :

output: {
   path: path.join(__dirname, outputDirectory),
   filename: 'bundle.js',
   publicPath: '/',    -->ADD THIS
 },


 devServer: {
   historyApiFallback: true,      --> ADD THIS
   port: 3000,
   open: true,
   proxy: {
     '/api': 'http://localhost:8080'
   }
 },

@abhiram5 @atrimn I belive that you didn't define route for /linkedin
Please do it by adding this route somewhere in your application

import { Route } from 'react-router-dom';
import { LinkedInPopUp } from 'react-linkedin-login-oauth2';

        ...
         <Route exact path="/linkedin" component={LinkedInPopUp} />
        ...

Feel free to reopen this issue if your problem still persists.