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

Google Auth popup not working (Solution) #29

Open
aishikanandi opened this issue Dec 22, 2022 · 4 comments
Open

Google Auth popup not working (Solution) #29

aishikanandi opened this issue Dec 22, 2022 · 4 comments

Comments

@aishikanandi
Copy link

aishikanandi commented Dec 22, 2022

  1. Change app.get('/auth/google") :

app.get("/auth/google",
passport.authenticate('google',{ scope: ["profile"] }),
function(req, res) {
// Successful authentication, redirect to secrets.
res.redirect("/auth/google/secrets");
});

  1. Use :
    passport.serializeUser((user, done) => done(null, user));
    passport.deserializeUser((user, done) => done(null, user));

Instead of:
passport.serializeUser(User.serializeUser());
passport.deserializeUser(User.deserializeUser());

  1. Also, remove:
    userProfileURL :"https://www.googleapis.com/oauth2/v3/userinfo" from GoogleStrategy. It is no longer needed.
    Google Auth popup must work now.
@Joshuaatanu
Copy link

thank you

@PiyushKamble
Copy link

i am getting Access blocked: Authorization Error after registering through google email id.

@Joshuaatanu
Copy link

Joshuaatanu commented Apr 2, 2023

Hey , check my repo to see if you found the solution , my code works

@prince-sunsara
Copy link

Thank you so much. i have been looking for this answer since 3 days and finally i get my answer by this post. thank you so much once again.

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

4 participants