Some errors you may encounter: 1. TypeError: req.session.regenerate is not a function using Passport soln: Downgrade passport to version 0.5. npm uninstall passport, npm install passport@0.5 2. Uncaught TypeError: Cannot read properties of undefined (reading 'user') soln: Pass 'user' as props directly in Home component instead of userDetails. remove line 'const user = userDetails.user' 3. Cannot GET a route. soln: add forward slash to the begining of your routes in server folder, auth.js and server.js Will add more if I find any..Happy Coding
Please note that In both login and signup pages, the url should be changed to "auth/google" instead of "auth/google/callback". Thanks for the tutorial by the way.
I got ""The OAuth client was not found. If you are a developer of this app, see error details. Error 401: invalid_client"" while sign in with google why??? help
Hi! I have deployed the front and backend in Render! Thank you! My app works well in the localhost but in the deployment I cannot get the user after logging with gmail...I am not working with websocket but I realized I got websocket failed I do not know if that is relevant. What am I doing wrong? thank you
You really worked hard, I appreciate that. But next time instead of pasting directly you can write the codes manually it makes it easy to catch up with the code. Try to be a little slow also when explaining.
Those who are facing response_type not provided error while logging in, add this code to the passport.js file passport.use( new GoogleStrategy( { clientID: process.env.CLIENT_ID, clientSecret: process.env.CLIENT_SECRET, callbackURL: "/auth/google/callback", scope: ["profile", "email",], response_type: "application/json" }, function (accessToken, refreshToken, profile, callback) { callback(null, profile); } ) );
wasted my precious time because he did not show actually if it is working or not after creating it that's the reason many guys complaining it is not working
Brother, "The support of Google Sign-In JavaScript platform library for Web is set to be deprecated after March 31, 2023", after this Is there any thing new to do?
we have initialized passport module in that file. By importing that file in index.js every code in that file will execute. If you don't import that file it will not work.
If anyone got an error saying: "Error: Unknown authentication strategy "google"". Then simply import it in server.js without giving it a name: CommonJS: require("./passport"); ES6: import "./passport");
@@bhavilahuja7092 Those lines simply initialize passportjs and its session. Importing the file sets all the configuration needed to run the functions in passportjs
Some errors you may encounter:
1. TypeError: req.session.regenerate is not a function using Passport
soln: Downgrade passport to version 0.5. npm uninstall passport, npm install passport@0.5
2. Uncaught TypeError: Cannot read properties of undefined (reading 'user')
soln: Pass 'user' as props directly in Home component instead of userDetails. remove line 'const user = userDetails.user'
3. Cannot GET a route.
soln: add forward slash to the begining of your routes in server folder, auth.js and server.js
Will add more if I find any..Happy Coding
thank you so much
bro, you know if exist a solution to the first error without downgrading? I red that v0.5 of passport have some vulnarability issues
thanks man.... wasted 1 week for this integration, this video is very helpful. appreciate
req.user is undefined in production, any idea how to fix this prblm?
Did you solved that?
Great video but i didbt see you save user into mongo as implied by the title of the video
thanks for the code man. but i wish you had talked about the process for us to think better next time were connecting to an api
Please note that In both login and signup pages, the url should be changed to "auth/google" instead of "auth/google/callback".
Thanks for the tutorial by the way.
I got ""The OAuth client was not found.
If you are a developer of this app, see error details.
Error 401: invalid_client"" while sign in with google why??? help
did you fix it?
@@faisalsaeed877 i referred documentation
why passport setup needs to be imported in server.js when we are not using it there?
if you're not import, code in passport file will not run😅, because npm start only start server.js file, in this file you can import to run other file
Honestly, Didn't liked the video. You should have to explain what code does, just little bit. Instead of pasting code, better writting
Were we making this without the help of Database ?
nice bro helpful your youtub chanles
@CyberWolves this is not working when I host the api, its giving me success with error code 403, please help
using callback how to store data in database can you guide me>? and it's possible so let me know using frontend domain in google cloud console?
Hi! I have deployed the front and backend in Render! Thank you! My app works well in the localhost but in the deployment I cannot get the user after logging with gmail...I am not working with websocket but I realized I got websocket failed I do not know if that is relevant. What am I doing wrong? thank you
Failed to load resources the server respond with a status of 404 (Not found) error
What i shal do??
/auth/google : route not used in this. Please help me to fix it
You're right. You should change the URLs inside login and sign up components to "auth/google" instead of "auth/google/callback"
You really worked hard, I appreciate that. But next time instead of pasting directly you can write the codes manually it makes it easy to catch up with the code. Try to be a little slow also when explaining.
Those who are facing response_type not provided error while logging in, add this code to the passport.js file
passport.use(
new GoogleStrategy(
{
clientID: process.env.CLIENT_ID,
clientSecret: process.env.CLIENT_SECRET,
callbackURL: "/auth/google/callback",
scope: ["profile", "email",],
response_type: "application/json"
},
function (accessToken, refreshToken, profile, callback) {
callback(null, profile);
}
)
);
wasted my precious time because he did not show actually if it is working or not after creating it that's the reason many guys complaining it is not working
Getting a 403 error when i cloned the repo and ran the code, any ideas?
did you fix it?
How to create a token for this kind of Operation?
Hi! how do I do login with facebook and github? Thank you!
great video! Just had a small query. What's the font and theme you are using for vs code?
Brother, "The support of Google Sign-In JavaScript platform library for Web is set to be deprecated after March 31, 2023", after this Is there any thing new to do?
Bro had to catch train ig
This video was really helpful but can you please tell me how to use this login in my existing react web application?
Why you create passport file and does not use it ?
we have initialized passport module in that file. By importing that file in index.js every code in that file will execute. If you don't import that file it will not work.
@@CyberW0lves you dose not execute passport file in index.js
@@CyberW0lves i do import the passport file but since it is not excute it gave error in backend terminal
Great work. but Explanation is too fast which makes difficult for beginners to understand.
how to redirect to front end after server side auth
Access blocked: authorisation error
If anyone got an error saying: "Error: Unknown authentication strategy "google"". Then simply import it in server.js without giving it a name:
CommonJS:
require("./passport");
ES6:
import "./passport");
Then what about the app.use(passport.initialize()) and app.use(passport.session())?
@@bhavilahuja7092 Those lines simply initialize passportjs and its session. Importing the file sets all the configuration needed to run the functions in passportjs
@@sajawalhassan1f12 Never mind, I successfully completed my task
@@bhavilahuja7092 :)
i'm not able to do it with discord
i don't want to sing with google. You will know if you have noticed
please tell me in detail brother,what you want to say ,so that i will not use also
Nice video, thanks so much. I want to asked if I will add my credit card or pay to use Oauth in my project?
u captioned as mern but not used mongo what the hell
I don't want to sing with Google
Don't sing then 😂
@@tanmayhedau5342 its a joke lol
Thanks for the video. However you seem to be moving very fast in the video
React is for frontend?
yes
can we do the same with discord ???
Arey bhai last me demo to dikha deta
title mai yha react kyu likha ?
Excellent content
Great Help !!
i am getting No routes matched location "/undefined/auth/google/callback" ...I'm i doing something wrong?
You need to Replace the process.env with the Localhost port i faced the same issue, because in the video in the video sir have used .evn file
@@kunaljethva9623 thank you, I'll try that
@@kunaljethva9623 could u please clear this again im getting same error
thank you I had the same issue
@@WizowskiTheCow bro, How did you solve this problem?
Thank you very much sir!
thanks was really helpful
very helpful 🙏
you did a great job thank you so much
happy singing
Hey cyberwolf, can you make a video on how to do this with mongodb?
apne mera sara code khrab krdia
mera bhi krdia 😭😭😭😭
thankyou bro
thnx❤
thank you. its working
THANK YOU
❤
thanks!
Time waste, too many errors, a big thumbs down.
this video is a fraud please don't wase time watching it, it does not teach how to actually implement google auth fully.