Google oauth redirect URL is react routed page. How can I use passport.authenticate middleware to extract user info?
passport.use( new GoogleStrategy({ clientID:”xyz.apps.googleusercontent.com”, clientSecret:”xyz”, callbackURL:’http://localhost:5173/loggedin’ }, (accessToken, refreshToken, profile, done)=>{ console.log(profile) }) ) Here’s the react router code in which i wanna use above passport authenticate middlware: <Router> <Routes> <Route path=”/” element={<App/>}/> <Route path=”/loggedin” element={<LoginPage/>}/> </Routes> </Router> Here’s code for express server: app.get(‘/’, passport.authenticate(‘google’, { scope: [‘profile’] })) app.get(‘http://localhost:5173/loggedin’, passport.authenticate(‘google’),(req, res)=>{ res.send(“logged in”) //there […]