score:0
i'm not positive but i think your problem might be in your configuration/configuration2 (i'm assuming these are different configurations for your passport?). configuration looks good if you just add some code to it from configuration 2.
const passport = require('passport');
const googlestrategy = require('passport-google-oauth').oauth2strategy;
passport.serializeuser(function (user, done) {
done(null, user);
});
passport.deserializeuser(function (user, done) {
done(null, user);
});
passport.use(
new googlestrategy(
{
clientid:'secretclientid',
clientsecret: 'enterclientsecret',
callbackurl: 'http://localhost:3000/auth/google/callback',
},
function (accesstoken, refreshtoken, profile, done) {
var userdata = {
email: profile.emails[0].value,
name: profile.displayname,
token: accesstoken,
};
done(null, userdata);
},
),
);
again, i'm not 100% on my answer but maybe try this and see if it helps. best of luck!
Source: stackoverflow.com
Related Query
- PassportJS Google Auth in MERN not working
- Google analytics with react is not working
- ReactJS & Google MDL Button onClick not working
- Google Optimize not working with React App (no cookie set)
- AWS Amplify Google auth user not redirected back
- React.memo not working with functoinal components and google maps
- Firebase auth and React Hook - returning function from hook not working
- react js google translate not working
- Google login authentication feature not working (Google firebase)
- Passport.js Google strategy is not working with the React application
- Axios: Basic auth not working with GET request
- Protected Routes React Router 4 not working with auth state stored in Redux
- Google Sign out not working properly using react
- React react-router-dom private route not working when auth token is asynchronously loaded from cookies
- Reactjs web app google maps working on PC localhost but not on mobile
- Importing fonts from Google fonts and adding it to CreateGlobalStyle not working properly
- Google Places autocomplete not working (in Bootstrap modal)
- findOneAndDelete Mongoose not working MERN stack
- POST request works in localhost but not working after deploying to the google cloud
- Fetch API with Google Directions API is not working in reactjs
- getPlace function not working with Google Autocomplete in react
- Image upload in mern stack using multer not working
- MERN App Deployed to Heroku Not Working Properly
- My app is blocked using Google Strategy with PassportJs and MERN
- Create React App proxy to express server for PassportJS not working
- Redirect react router dom auth not working
- Google Cloud not working on Node.js
- React | Package.Json | "proxy" Not Working in Google App Engine
- Docker MERN Deployment - hot reload is not working
- Django - React - Google Cloud Storage SigedURL upload is not working
More Query from same tag
- how to send the confidential info like username and password in get request for login
- how to check if a product is repeated in shopping card in redux toolkit and react js
- Add query parameter in the middle of the URL using react fetch
- API call getting CORS error in ReactJS but getting response in node and postman
- Is there a conflict rule in css? My fadein keyframes works fine but my slidedown doesn't
- This.props is empty for some reason (React.js)
- JavaScript - Replace a string with anchor tag while fetching data from JSON Array
- Camera Preview in Expo is Distorted
- How can i generate a unique key for my key prop inside a map? React
- Victory Chart issues with spacing between axis and tickValues
- React Testing Library - Simulating uploading file with FileReader
- ES2015 non-mutating array swap in React component (or flux action)
- Infowindow re rendering whole google map with thousands of marker everytime
- Can't access reducer state values for printing into presentational component?
- Calling data from js file to react component
- Concatenate strings within array of objects
- Counter in react-js run only once when Component Re-Render?
- How do I make and event and have an alert in ReactJS?
- Uncaught TypeError: _this.props.onToggle is not a function
- Error with @reduxjs/toolkit and Typescript - TS1005
- getstream channel EmptyStateIndicator typescript error
- Duplicate identifier 'LibraryManagedAttributes'
- Uncaught TypeError: tasks.map is not a function
- jest enzyme reactJS - method executes regardless of return
- how to setup nginx config to make from react js to communicate with node js in docker
- Infinite Loop Fetching
- Can you invoke the same useState hook within the same function more than once?
- Exports defaults else path not taken with Jest and ES6
- You may need an appropriate loader to handle this file type. React & Material UI
- React: NoReverseMatch: Reverse for 'password_reset_confirm' not found. 'password_reset_confirm' is not a valid view function or pattern name