Login With Google Using React & Node - MERN Auth 2.0

แชร์
ฝัง
  • เผยแพร่เมื่อ 26 ธ.ค. 2024

ความคิดเห็น • 86

  • @zebedee788
    @zebedee788 ปีที่แล้ว +47

    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

    • @jayeshargade2179
      @jayeshargade2179 ปีที่แล้ว +1

      thank you so much

    • @JonathanRuiz-xu4yl
      @JonathanRuiz-xu4yl ปีที่แล้ว +3

      bro, you know if exist a solution to the first error without downgrading? I red that v0.5 of passport have some vulnarability issues

  • @ShetDeeptesh
    @ShetDeeptesh 2 หลายเดือนก่อน +1

    thanks man.... wasted 1 week for this integration, this video is very helpful. appreciate

  • @uboxtech
    @uboxtech ปีที่แล้ว +2

    req.user is undefined in production, any idea how to fix this prblm?

  • @samuelkusi8079
    @samuelkusi8079 ปีที่แล้ว +10

    Great video but i didbt see you save user into mongo as implied by the title of the video

  • @tarekghosn3648
    @tarekghosn3648 2 ปีที่แล้ว +8

    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

  • @pouriarezaei625
    @pouriarezaei625 ปีที่แล้ว +2

    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.

  • @reshnarajan8466
    @reshnarajan8466 ปีที่แล้ว

    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

  • @Triwizard109
    @Triwizard109 ปีที่แล้ว

    why passport setup needs to be imported in server.js when we are not using it there?

    • @ki-sg9ig
      @ki-sg9ig ปีที่แล้ว

      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

  • @yashvishwakarma7907
    @yashvishwakarma7907 ปีที่แล้ว +37

    Honestly, Didn't liked the video. You should have to explain what code does, just little bit. Instead of pasting code, better writting

  • @csec0565
    @csec0565 9 หลายเดือนก่อน

    Were we making this without the help of Database ?

  • @yadavkishan3778
    @yadavkishan3778 2 ปีที่แล้ว

    nice bro helpful your youtub chanles

  • @namansharma7531
    @namansharma7531 ปีที่แล้ว

    @CyberWolves this is not working when I host the api, its giving me success with error code 403, please help

  • @jenilsatani2671
    @jenilsatani2671 2 ปีที่แล้ว +1

    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?

  • @fullstack-user-api
    @fullstack-user-api 7 หลายเดือนก่อน

    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

  • @rajneeshgangwar6022
    @rajneeshgangwar6022 2 ปีที่แล้ว

    Failed to load resources the server respond with a status of 404 (Not found) error
    What i shal do??

  • @deepanshuheer01
    @deepanshuheer01 ปีที่แล้ว

    /auth/google : route not used in this. Please help me to fix it

    • @pouriarezaei625
      @pouriarezaei625 ปีที่แล้ว +1

      You're right. You should change the URLs inside login and sign up components to "auth/google" instead of "auth/google/callback"

  • @rootbattlegrounds7948
    @rootbattlegrounds7948 ปีที่แล้ว +5

    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.

  • @SunilKumar-fh6jk
    @SunilKumar-fh6jk ปีที่แล้ว +1

    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);
    }
    )
    );

  • @naqiabedi
    @naqiabedi ปีที่แล้ว +1

    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

  • @MindOFAlfie
    @MindOFAlfie ปีที่แล้ว

    Getting a 403 error when i cloned the repo and ran the code, any ideas?

  • @amirrai5523
    @amirrai5523 ปีที่แล้ว

    How to create a token for this kind of Operation?

  • @fullstack-user-api
    @fullstack-user-api 8 หลายเดือนก่อน

    Hi! how do I do login with facebook and github? Thank you!

  • @gunpreetsingh2256
    @gunpreetsingh2256 ปีที่แล้ว +6

    great video! Just had a small query. What's the font and theme you are using for vs code?

    • @videoexplore1
      @videoexplore1 ปีที่แล้ว

      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?

  • @skillradius9867
    @skillradius9867 3 หลายเดือนก่อน

    Bro had to catch train ig

  • @madhurimalviya4443
    @madhurimalviya4443 2 ปีที่แล้ว +4

    This video was really helpful but can you please tell me how to use this login in my existing react web application?

  • @salehm5413
    @salehm5413 2 ปีที่แล้ว

    Why you create passport file and does not use it ?

    • @CyberW0lves
      @CyberW0lves  2 ปีที่แล้ว

      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.

    • @salehm5413
      @salehm5413 2 ปีที่แล้ว +1

      @@CyberW0lves you dose not execute passport file in index.js

    • @rajilaziz8380
      @rajilaziz8380 ปีที่แล้ว

      @@CyberW0lves i do import the passport file but since it is not excute it gave error in backend terminal

  • @sunilnoolu1508
    @sunilnoolu1508 11 หลายเดือนก่อน +1

    Great work. but Explanation is too fast which makes difficult for beginners to understand.

  • @jyothinkjayan6508
    @jyothinkjayan6508 2 ปีที่แล้ว

    how to redirect to front end after server side auth

  • @princebabariya-fh2dx
    @princebabariya-fh2dx ปีที่แล้ว

    Access blocked: authorisation error

  • @sajawalhassan1f12
    @sajawalhassan1f12 2 ปีที่แล้ว +6

    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
      @bhavilahuja7092 ปีที่แล้ว

      Then what about the app.use(passport.initialize()) and app.use(passport.session())?

    • @sajawalhassan1f12
      @sajawalhassan1f12 ปีที่แล้ว

      @@bhavilahuja7092 Those lines simply initialize passportjs and its session. Importing the file sets all the configuration needed to run the functions in passportjs

    • @bhavilahuja7092
      @bhavilahuja7092 ปีที่แล้ว

      @@sajawalhassan1f12 Never mind, I successfully completed my task

    • @sajawalhassan1f12
      @sajawalhassan1f12 ปีที่แล้ว

      @@bhavilahuja7092 :)

  • @breakingbad378
    @breakingbad378 2 ปีที่แล้ว

    i'm not able to do it with discord

  • @sammed.sankonatti
    @sammed.sankonatti 9 หลายเดือนก่อน

    i don't want to sing with google. You will know if you have noticed

    • @gautamkumarverma2929
      @gautamkumarverma2929 หลายเดือนก่อน

      please tell me in detail brother,what you want to say ,so that i will not use also

  • @nwaformicah433
    @nwaformicah433 8 หลายเดือนก่อน

    Nice video, thanks so much. I want to asked if I will add my credit card or pay to use Oauth in my project?

  • @MdAzharuddin-h3u
    @MdAzharuddin-h3u 3 หลายเดือนก่อน

    u captioned as mern but not used mongo what the hell

  • @9dwd
    @9dwd ปีที่แล้ว +1

    I don't want to sing with Google

    • @tanmayhedau5342
      @tanmayhedau5342 ปีที่แล้ว

      Don't sing then 😂

    • @zappist751
      @zappist751 ปีที่แล้ว

      @@tanmayhedau5342 its a joke lol

  • @japan9169
    @japan9169 ปีที่แล้ว

    Thanks for the video. However you seem to be moving very fast in the video

  • @hiddensoldier6770
    @hiddensoldier6770 2 ปีที่แล้ว

    React is for frontend?

  • @breakingbad378
    @breakingbad378 2 ปีที่แล้ว

    can we do the same with discord ???

  • @riteshsingh4150
    @riteshsingh4150 ปีที่แล้ว +1

    Arey bhai last me demo to dikha deta

  • @anuragdixit3581
    @anuragdixit3581 ปีที่แล้ว

    title mai yha react kyu likha ?

  • @nxshipon6470
    @nxshipon6470 2 ปีที่แล้ว +1

    Excellent content

  • @ABHAY00_7
    @ABHAY00_7 9 หลายเดือนก่อน

    Great Help !!

  • @kamichikora6035
    @kamichikora6035 2 ปีที่แล้ว

    i am getting No routes matched location "/undefined/auth/google/callback" ...I'm i doing something wrong?

    • @kunaljethva9623
      @kunaljethva9623 2 ปีที่แล้ว +3

      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

    • @kamichikora6035
      @kamichikora6035 2 ปีที่แล้ว

      @@kunaljethva9623 thank you, I'll try that

    • @mansinagaria2034
      @mansinagaria2034 ปีที่แล้ว

      @@kunaljethva9623 could u please clear this again im getting same error

    • @WizowskiTheCow
      @WizowskiTheCow ปีที่แล้ว

      thank you I had the same issue

    • @akashsuryavanshi7026
      @akashsuryavanshi7026 ปีที่แล้ว

      @@WizowskiTheCow bro, How did you solve this problem?

  • @masterTimon01
    @masterTimon01 ปีที่แล้ว

    Thank you very much sir!

  • @Ravikumar-nc9bz
    @Ravikumar-nc9bz ปีที่แล้ว

    thanks was really helpful

  • @vaibhavgangurde2995
    @vaibhavgangurde2995 ปีที่แล้ว

    very helpful 🙏

  • @erhan1
    @erhan1 2 ปีที่แล้ว

    you did a great job thank you so much

  • @leeskies329
    @leeskies329 ปีที่แล้ว

    happy singing

  • @zappist751
    @zappist751 ปีที่แล้ว +1

    Hey cyberwolf, can you make a video on how to do this with mongodb?

  • @Abundify
    @Abundify 4 หลายเดือนก่อน

    apne mera sara code khrab krdia

    • @ayushbhatt2352
      @ayushbhatt2352 4 หลายเดือนก่อน

      mera bhi krdia 😭😭😭😭

  • @yrama4714
    @yrama4714 7 หลายเดือนก่อน

    thankyou bro

  • @prodev08
    @prodev08 ปีที่แล้ว

    thnx❤

  • @hariharanmohan273
    @hariharanmohan273 2 ปีที่แล้ว

    thank you. its working

  • @mangeshpandit4660
    @mangeshpandit4660 ปีที่แล้ว

    THANK YOU

  • @chandrashekharjoshi6907
    @chandrashekharjoshi6907 ปีที่แล้ว

  • @alanye7542
    @alanye7542 2 ปีที่แล้ว

    thanks!

  • @RA-ks5wt
    @RA-ks5wt ปีที่แล้ว

    Time waste, too many errors, a big thumbs down.

  • @kshitizsachan7196
    @kshitizsachan7196 ปีที่แล้ว

    this video is a fraud please don't wase time watching it, it does not teach how to actually implement google auth fully.