Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Passport session not store on google login #134

Open
jay42719 opened this issue Oct 9, 2018 · 1 comment
Open

Passport session not store on google login #134

jay42719 opened this issue Oct 9, 2018 · 1 comment

Comments

@jay42719
Copy link

jay42719 commented Oct 9, 2018

Backend Localhost Server Start on - localhost: 3000

Forntend Localhost React Server Start on - localhost: 3001

Backend Production Server Start on - 192.168.0.2: 3000

Forntend Production React Server Start on - 192.168.0.3: 3001

  • I used passport localStrategy for normal login and passport googleStrategy for google login.

  • Normal login working fine with passport local Strategy on localhost and production server.

  • Google login working fine with passport google Strategy on localhost but not working on production because backend server and frontend server start on different ip address.

passport.serializeUser(async (user, done) => {
	done(null, user.id);
});

passport.deserializeUser(async (id, done) => {
	const userData = await findById(id);
	if (userData.error != null || userData.data.length == 0)
		done({ message: LOGIN_FAILED }, false);
	else
		done(null, userData.data);
});
  • When try to google login on production server "passport.serializeUser" call but "passport.deserializeUser" not call on backend.

  • Why session not store on google login on production?

@JasonSteelmanCoder
Copy link

I have the exact same problem. Any solutions?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants