Google Identity Services Login with React (2023 React Google Login)

Поділитися
Вставка
  • Опубліковано 14 жов 2024

КОМЕНТАРІ • 554

  • @thecyrusj13
    @thecyrusj13 Рік тому +70

    Thanks!

    • @CooperCodes
      @CooperCodes  Рік тому +22

      Yo this is my first super thanks! And the fact that its 10 bucks! You are way too kind, thank you so much :) this channel is genuinely a labor of love which I hope people see in the content, and I look forward to providing more in the future. This donation genuinely means so much to me. Thank you for your kindness.

    • @thecyrusj13
      @thecyrusj13 Рік тому +9

      @@CooperCodes Oh yeah. You're welcome. Enough for a down payment on a six pack of beer right? Good luck with everything.

    • @CooperCodes
      @CooperCodes  Рік тому +6

      Hahaha I'll use my down payment wisely, thank you for the kind words and support

  • @HemantDuttaHD
    @HemantDuttaHD 2 роки тому +89

    You're a life saver mate! I was following a 5 hour long tutorial trying to make social media app using react and the guy was using the outdated method for this google oauth thing and I was losing my mind. Thank you so much! You've been a huge help!

    • @CooperCodes
      @CooperCodes  2 роки тому +5

      You are absolutely welcome, glad to see my video got you on your way.

    • @weizhao7896
      @weizhao7896 2 роки тому +1

      hey, have u successfully updated the google sign-in from the old version? I watched this video and come back try to fix the old one, but just get stuck T^T

    • @HemantDuttaHD
      @HemantDuttaHD 2 роки тому +1

      @@weizhao7896 I followed this tutorial and things worked perfectly

    • @ayushnegi3610
      @ayushnegi3610 2 роки тому +6

      From javascript mastery right?

    • @weizhao7896
      @weizhao7896 2 роки тому +4

      @@ayushnegi3610 for me, yes. Lol

  • @luberalexanderechavarriabe4156

    Everyone does not have the skill to teach easily and clearly mate, but you do. You made it simple and straightforward, thanks a lot.
    I got the error, google doesn't exist, Just in case someone else gets the same, you have to add window. google.............(add window before google)

    • @Manja-rd3dr
      @Manja-rd3dr Рік тому

      Thanks 😃

    • @DanielMShawn
      @DanielMShawn Рік тому

      This saved me hours, thank you!

    • @solo-yl8uc
      @solo-yl8uc Рік тому

      thanks, but I wonder why is he didn't get an google doesn't exist error...

    • @charleneleclerc9205
      @charleneleclerc9205 Рік тому

      not working for me, i have always an error "window.google.account is undefined" and i don't understand why😢
      Sorry in advance for my english

  • @pippinbloom
    @pippinbloom Рік тому +9

    In viewing this, I didn't realize that the comment /* global google */ was actually necessary and not just a regular comment.Thank you so much!!

  • @oscargalvez7
    @oscargalvez7 2 роки тому +12

    Amazing tutorial! I have watched plenty of tutorials overall and this is one of the easiest to understand and straight to the point. Also, I loved how I just did what you said and it worked the first time! That doesn't happen often. Keep it up 💯💯

    • @CooperCodes
      @CooperCodes  2 роки тому +1

      Thanks so much for the comment! Glad the content was helpful :)

    • @oscargalvez7
      @oscargalvez7 2 роки тому

      @@CooperCodes Sure it was, I already implemented it into my app. Great work!

  • @selim3291
    @selim3291 Рік тому +1

    Thanks a lot! Not just for the Google Login, you are telling what are you doing step by step. This is so important to understand the logic of the code.

  • @thecyrusj13
    @thecyrusj13 Рік тому +8

    Thanks so much dude. Google Technical Support couldn't even help me out as much as you did. The official Google docs on this didn't even mention React (as far as I know). The docs were frightening and I thought I would never figure this out with all the rabbit holes and snail trails. But anyway, I've watched 4 other videos on one-tap and yours is the first one that makes use of the sign in button if the user is not already logged in. One note I would add is that instead of using /* global google */ you can use window.google.accounts.id, etc. When I searched for "google one-tap" I didn't find your video. I had to search for "google signin". So if you added "one-tap" as a tag or search word it might increase your views (if you haven't already). It's nice that I didn't have to set up fake server and use the google-auth-library package for this to work also.

    • @CooperCodes
      @CooperCodes  Рік тому +3

      Yeah hah when I made this video this stuff was super fresh. If I were to do the video over again I would definitely grabh google from the window object like you suggest, luckily its a one line fix but still wish it was in the video. Glad this was helpful! The Google documentation is surprisingly awful... considering its yah know... Google???

  • @frontend_ko
    @frontend_ko 7 місяців тому +1

    thanks, man. it works perfectly. instruction is simple and concise

  • @lowmikow1099
    @lowmikow1099 5 місяців тому

    Thank you som much for this tutorial! I've been looking for well-explained installation and usage of the new Google login!

  • @user-fq7jf6cp9p
    @user-fq7jf6cp9p Рік тому +1

    You've earned a sub and a like, you know how to program things really well and explain it to beginners so we dont scratch our heads until hair starts falling off. You showed me that I have a programming knowledge deficiency.

  • @suryaafs
    @suryaafs Рік тому +1

    I was looking for profile object and then it turn out to be decoded credentials. You're such a life saver, thank you so much! What an amazing tutorial

    • @CooperCodes
      @CooperCodes  Рік тому

      You're very welcome, glad it helped you out especially in that specific scenario :)

  • @LuisPerez-MATB
    @LuisPerez-MATB 11 місяців тому +1

    Perfectly working October 2023, thanks for the tutorial! Very easy and understandable

    • @SurbhiYadav-i1z
      @SurbhiYadav-i1z 10 місяців тому

      hey i need help , idk there is an error jwt_decode is not a function
      can you help me with this?

    • @simransingh5496
      @simransingh5496 10 місяців тому

      @@SurbhiYadav-i1z yeah i just ran into this, if you go into the node_modules and see, the current function is actually jwtDecode (without the underscore).

  • @Bruno87198
    @Bruno87198 2 роки тому +3

    Thanks for the video! The "/* global google */ explanation was really helpful!

    • @CooperCodes
      @CooperCodes  2 роки тому +1

      Thank you, appreciate it! The global google is a little strange, but I found it to be a good solution when depending on scripts from your HTML like I discussed in the video. Appreciate the support

  • @bugraotken
    @bugraotken 10 місяців тому

    Among all the other videos related with React and Google auth, this is the far most helpful video. I can't thank you enough =))

  • @PersianShare
    @PersianShare Рік тому +1

    JUST WOOOW, super clear, I WISH I COULD HAVE LIKE THIS VIDEO MORE THAN ONCE

    • @CooperCodes
      @CooperCodes  Рік тому +2

      You can like this comment too! Thanks for watching hahaha

  • @selectablekitchen5315
    @selectablekitchen5315 2 роки тому +1

    OMG THANK YOU!!! I went through hours of "beginner" guides before I could find tNice tutorials and at least make a simple soft... Only video I've

  • @merzeofficials7344
    @merzeofficials7344 11 місяців тому

    just started learning react and came across your video. it took my entire day but worth it as its working same as he shown his video! but there were some code declaration errors which I faced. but still bundles of thanks

  • @sangkyunkim-n5g
    @sangkyunkim-n5g 8 місяців тому

    Awesome!! Clear and accurate explanation. It helps me a lot. Thank you so much!

  • @Morexod999
    @Morexod999 2 роки тому +2

    It was helpful as hell, like a bless after hours spended with implicit google API docs

  • @condorkunka
    @condorkunka 8 місяців тому

    Thank you, Cooper Code, for providing such a through explanation! It was incredibly helpful.

  • @mohammadrahman8911
    @mohammadrahman8911 2 роки тому +16

    Thank you for this! Qq...once the user is logged in...what's the recommended approach for backend API authorization? If I have an Express backend...can you send the Bearer token in the header?

    • @osrs-raph
      @osrs-raph Рік тому

      You could use a library that allows you to set cookies and create a "token" cookie, then on the backend verify that token. I'm not sure about the backend details but I'm sure there is a function to validate it.

  • @fardinkashef3604
    @fardinkashef3604 Рік тому +1

    That's how a tutorial should be. Great job. I really liked it.

  • @yyk9881
    @yyk9881 2 роки тому

    Easy to follow, voice is clear, explanations are perfect!!!!!!!

  • @shireensheikh505
    @shireensheikh505 8 місяців тому

    2024 Jan- this works! Thanks man for making this video! Helped me loads

  • @kushagra4401
    @kushagra4401 2 роки тому +2

    Thank you so much for this. you are a life saver. i was having problems working with old oauth and spent hours on it. finally this worked

    • @CooperCodes
      @CooperCodes  2 роки тому +1

      Glad to see it was helpful! Thank you for watching and supporting :)

    • @kushagra4401
      @kushagra4401 2 роки тому

      @@CooperCodes Hey! is there any way we can customize the button rendered by it, like i want to align it center by default it is right aligned. i have tried css properties and different ways but couldn't figure it out

    • @rajatkushwaha279
      @rajatkushwaha279 2 роки тому

      can u send the code?? It's too long to write :{

    • @kushagra4401
      @kushagra4401 2 роки тому

      @@rajatkushwaha279
      const googleLogin = (res) => {
      const userCred = res.credential;
      const user = jwtDecode(userCred);
      // use the user data
      };
      useEffect(() => {
      /* global google */
      google.accounts.id.initialize({
      client_id: "your client id here",
      callback: googleLogin,
      });
      // mention id of btn, here i used googlelogin
      google.accounts.id.renderButton(document.getElementById("googleLogin"), { theme: "outline", size: "large", fullWidth: true });
      }, []);

    • @rajatkushwaha279
      @rajatkushwaha279 2 роки тому +1

      @@kushagra4401 Thanks :)

  • @ShakilKhatri1
    @ShakilKhatri1 11 місяців тому

    This is exactly what I was looking for!
    Thanks!

  • @medweb8690
    @medweb8690 2 роки тому +1

    Wow, this is a great tutorial. I'm having to force the npm install of react-google-login. Is there another updated package? I'm googling where to find such an update since the deprecation on July 29th. Thank you for taking the time to make this video for all to see.

  • @aylanelson1012
    @aylanelson1012 Рік тому +1

    Love the Tutorial:
    Is there any reason that the token might fail? And do you have suggested work arounds!
    Cross-Origin-Opener-Policy policy would block the window.postMessage call.

  • @PiratesK1999
    @PiratesK1999 Рік тому

    Great Video. But I have one question
    Can we add scopes in order to access google photos or google drive?
    I working on app that need both of these APIs.
    Thanks btw

  • @anoopisaac
    @anoopisaac 11 місяців тому

    thanks for the amazing concise tutorial. I have doubt regarding what needs to be one token expires. Do I need to force user login again?

  • @ranamdissa
    @ranamdissa 26 днів тому

    Thanks a lot for this great tutorial. it solved me lots of trouble. Thanks

  • @knuckless__
    @knuckless__ Рік тому +2

    somebody wrote on ts?
    do you know how solve the problem with that(type script can not find a google..)
    maybe later gonna be more problems witch you solved
    can you write here solve?

  • @Patwal77
    @Patwal77 Рік тому +1

    Thanks! way better than google documentation.

    • @CooperCodes
      @CooperCodes  Рік тому

      Thank you so much for the donation, glad the video was helpful! Genuinely donations like this make my day and help me realize the impact my content has on others, so thank you.

  • @billschnoebelen40
    @billschnoebelen40 2 роки тому

    Thank you, thank you, thank you!!! I have been trying to get an old program running for two days. None of my old stuff worked. All the tutorials I tryed did not work. Nothing gave me the token!

    • @CooperCodes
      @CooperCodes  2 роки тому

      Glad the tutorials could help, thanks so much for commenting! :)

  • @foreigner268
    @foreigner268 2 роки тому +2

    Thanks for the video. Is there a way to format the Google signin button to use Material UI? I want it to use my theming.

  • @abdirisaqqasim3726
    @abdirisaqqasim3726 Рік тому

    Your video was extremely helpful and easy to follow. It saved me a lot of trouble. I would be grateful if you could make another video on how to redirect pages after login. Thank you for your assistance.

  • @karengallardo4480
    @karengallardo4480 2 роки тому

    I tNice tutorialnk you speak for a good portion of us.

  • @aneeshmohanan5121
    @aneeshmohanan5121 6 місяців тому +1

    10:49 The updated jwt decode code is
    import {jwtDecode} from 'jwt-decode';
    const userObject = jwtDecode(response.credential)
    console.log(userObject)
    posting this as I had error when executing the code in video. so thought might be helpful for anyone watching

  • @romuloneedy
    @romuloneedy Рік тому

    Thanks for the video.
    There is a way to change this way, to save a token.
    This would be to make future integrations, even if the user is not logged in and within the application?
    For example, creating events in Google Calendar.

  • @kuentasapp1199
    @kuentasapp1199 2 роки тому +6

    Great video! just one question, how can I use the token to avoid the login every time the page gets refreshed?

    • @PardoLiat
      @PardoLiat 2 роки тому

      I think I have the same problem, when refreshing it asks me to login again. Did you find any solution for that?

    • @sahilverma_dev
      @sahilverma_dev 2 роки тому +2

      for this you have to store the user data in localstorage and if there is no data in localstorage only then make a login call

    • @sahilverma_dev
      @sahilverma_dev 2 роки тому

      @Sai karthik Varanasi you can find detailed articles on the web.

    • @sahilverma_dev
      @sahilverma_dev 2 роки тому

      @Sai karthik Varanasi basically when user gets logged in google returns a object. just store that object into the localstoage and for next write the code in such way that first it'll look to the localstorage for the user data if its null or not exist login the user and if user data is present in the localstorage then no need to login the user.

    • @kushagra4401
      @kushagra4401 2 роки тому +1

      @Sai karthik Varanasi you have to store data in localstorage. you can do it by localStorage.setItem() function it takes two parameters first, what you want to name it lets say 'profile' and in second you have to pass data in string format (JSON.stringify). now when you want to access the data on refresh you can get data in useEffect (after refresh) using localStorage.getItem('profile') you have to pass the name you chose like i took profile for example.

  • @dudewithdonuts7639
    @dudewithdonuts7639 8 місяців тому

    Great tutorial man

  • @Quo777
    @Quo777 9 місяців тому

    Thanks a lot, you've save my day!

  • @bobross2404
    @bobross2404 Рік тому

    Great video, helped me create a sequence diagram for explaining this process. Liked!

    • @CooperCodes
      @CooperCodes  Рік тому

      Glad it was helpful :) thanks for watching

  • @ajdin1250
    @ajdin1250 2 роки тому +2

    Awesome explanations, thank you very much Sir.

  • @MadhavMishra-is9gb
    @MadhavMishra-is9gb Рік тому

    Can you also explain in brief that how can we then use the googel spreadsheet api's ? Do I need to use gapi ?

  • @niravthakar3813
    @niravthakar3813 Рік тому +1

    Thank you for providing valuable contents. Do you have any example to work with oauth 2.0 working with scope parameter to fetch the authorization code and then token?
    It will be great help if you have it. Thank you for your time.

    • @viktoriazruttova
      @viktoriazruttova Рік тому

      Hi, since you commented 11 days ago I assume you were successfully able to run this tutorial. I ca't run this because it shows error: 'google' is not defined... I included script in index.html...

  • @solo-yl8uc
    @solo-yl8uc Рік тому +3

    does anyone get "Cross-Origin-Opener-Policy policy would block the window.postMessage call." error?

  • @juanpedro_mario
    @juanpedro_mario Рік тому

    Thanks a lot for this video, super helpful.
    Please how do I style the button? Too small for where I want to use it

  • @emmanuelakogwu7761
    @emmanuelakogwu7761 Рік тому

    Nice video, very clear and on point but I have a question...
    How do we allow sign in from any Gmail account and not just the one added from the Google console

  • @mohsenahmadi4851
    @mohsenahmadi4851 2 роки тому +2

    Thanks for such a great tutorial. It was really helpful!👍🏻💯

    • @CooperCodes
      @CooperCodes  2 роки тому

      Thank you so much for the comment! Appreciate the support

  • @kaaarkaaa3492
    @kaaarkaaa3492 2 роки тому

    Agreed. All the others just turn your brain upside down. Nice tutorials is simple.

  • @KamTuPLAY
    @KamTuPLAY 2 роки тому +1

    Thank you! I used old version of google sign in and it threw me an error. So I decided to use new method and found your video. Thanks again for helping)))

    • @CooperCodes
      @CooperCodes  2 роки тому +1

      That is so great to hear that the video solved your problem! I made the video for people transitioning to the new login system, so glad to see it helped that case :)

  • @bgovindnaren7405
    @bgovindnaren7405 2 дні тому

    Awesome video thanks!

  • @rasmusbergstrm3060
    @rasmusbergstrm3060 Рік тому

    Fantastic video. Can you alter the JWT to contain roles and such or is it strictly readonly from googles side?

    • @osrs-raph
      @osrs-raph Рік тому +1

      As you are not the creator of the JWT and therefore don't know its secret, you won't be able to add properties to it and still get a valid token.

  • @adityanair3566
    @adityanair3566 Рік тому

    If we use useState, would not the state lose the user data when we refresh our page? Thismight render the signin button again, even though we are actually signed in.
    Really cool video btw!

  • @faheemahmad5882
    @faheemahmad5882 Рік тому

    You are so underrated 🙌 thanks

    • @CooperCodes
      @CooperCodes  Рік тому

      Thanks for watching Faheem, appreciate yah :)

  • @SubashBalasubramanianLatentVie
    @SubashBalasubramanianLatentVie 2 місяці тому

    Hello,
    index.html Using both async and defer together is technically allowed, but it does not follow the intended usage of these attributes and can cause confusion. According to the HTML specification, if both attributes are present, the async attribute takes precedence, and the defer attribute is ignore.

  • @Magnify.
    @Magnify. Рік тому

    If the user logged in and then refreshed the page will it undo their log in and ask them to log in again?

  • @tudoreugenchindea2414
    @tudoreugenchindea2414 2 роки тому +1

    Amazing video. I need to integrate this to my spring boot backend which uses JSESSIONID. Do you know how I could integrate that from this JWT token?

  • @vitor-is5od
    @vitor-is5od 2 роки тому

    Nice video! Can I make the login, checking user-mail in db? I think the userObject will have the email if user sign in google, right? Is it safe only check if the userObject email exists in my db?

  • @georgenwankwo2881
    @georgenwankwo2881 2 роки тому +1

    Great Tutorial! But i have a question. Your tutorial made use of jwt token but mine returns an access token which can't be decoded the way you did with the jwt. How do i go about this?

  • @mtejera
    @mtejera Рік тому

    Thank you so much! Amazing and straightforward tutorial. I appreciate it a lot!

    • @CooperCodes
      @CooperCodes  Рік тому +1

      Miguel thank you so much for watching and leaving a comment. I appreciate you back :)

    • @durgaprasadthandra4066
      @durgaprasadthandra4066 Рік тому

      Can any one help me I got "Google is not defined" error

  • @rahulprajapat1087
    @rahulprajapat1087 Рік тому

    Great Work Bro , Appreciated !!

  • @apexyu164
    @apexyu164 2 роки тому

    HI ! thanks for the video , can you shortly brief whats the different between this and the video of Google OAuth 2.0 Login for React in 5 minutes?

  • @williamcuervo4252
    @williamcuervo4252 2 роки тому

    up to now. Your soft is great too!

  • @levankantara
    @levankantara 2 роки тому +3

    Thank you! Works fine in Localhost, but i want to make it public. now I get error '[GSI_LOGGER]: The given origin is not allowed for the given client ID.' I can only log in with an Email that I manually added while in Testing stage.
    What extra steps do I need to make it useable " IN Production"?

    • @romanhrytsyshyn1966
      @romanhrytsyshyn1966 2 роки тому

      Did you find out the answer?

    • @levankantara
      @levankantara 2 роки тому

      @@romanhrytsyshyn1966 If i remember correctly, problem was in Javascript Origins. I forgot to include my website URL with 'www.' Make sure you include both with and without WWW

    • @romanhrytsyshyn1966
      @romanhrytsyshyn1966 2 роки тому

      @@levankantara Well, as I understood, I have another problem. I deployed my app using Github Pages and this auth doesn’t work because Github Pages works only with static data.

    • @levankantara
      @levankantara 2 роки тому

      @@romanhrytsyshyn1966 Yea, i hear people complain about github pages a lot. I used firebase for hosting as well

    • @levankantara
      @levankantara 2 роки тому

      it is very easy to deploy

  • @thewebsmith
    @thewebsmith 2 роки тому +1

    Great great video. My question, is there a way to set whether user is logged in from the response or that will have to be done using state management libraries like redux. Thank you.

    • @CooperCodes
      @CooperCodes  2 роки тому

      Sorry for getting to this 5 days later, Google is only going to use that callback function that sets our state on a successful login. Right now we can assume that if the user object in our useState is not empty (it has stuff), then a user is logged in. Although yes, I would recommend something like Redux to manage the logged in user.
      useState here was more just to handle the data in an easy way and make the tutorial a bit shorter in length, but just know that when that callback function gets called you can set the user in there with however you decide to manage data (Redux for example).

  • @benjamingartner5288
    @benjamingartner5288 Рік тому

    Insane thank you man!

  • @davidharmeyer3093
    @davidharmeyer3093 2 роки тому +2

    This is insanely helpful. Thanks so much.

  • @elpeliculero5570
    @elpeliculero5570 2 роки тому

    Thanks so much for your thoughtful and detailed videos! On to the soft!

  • @mohamadelhamed1098
    @mohamadelhamed1098 2 роки тому

    ITS WORKING! nice job dude

  • @mahdirafi6537
    @mahdirafi6537 2 місяці тому

    Very helpful... Thanks a lot

  • @brandonwie4173
    @brandonwie4173 9 місяців тому

    Thanks a ton. Wish they had typescript files for d.ts. Subed!

  • @daniyaldk946
    @daniyaldk946 2 роки тому

    All of my computers got the softwares here. I first install them on virtual environnt to make sure they're not malware. So I can assure

  • @kanhatiwari7150
    @kanhatiwari7150 2 роки тому +2

    why i am getting error every-time that "google is not defined" although my app is working fine but error message show every-time and then i have to close it manually any solution to this issue?

  • @fygure8756
    @fygure8756 9 місяців тому

    When you deploy, do you change the localhost and localhost:3000 to your application's endpoint? also would I need port :3000 ?I see we need both localhost and localhost:3000 that is why I ask

  • @burhmoment7759
    @burhmoment7759 2 роки тому

    Thanks for such a great tutorial! It helped me out so much. Also, do you know if there are refresh tokens with the new google sign in library and how I can access them?

    • @ankitpanda1860
      @ankitpanda1860 2 роки тому

      Same the token expires in 1hr. How to solve that? Did you find the answer?

    • @guruprasath7372
      @guruprasath7372 Рік тому

      @@ankitpanda1860 Did you find the answer to refresh id token mate ?

  • @davidjunior390
    @davidjunior390 2 роки тому +1

    Overall best tutorial on this... Many thanks!!

    • @CooperCodes
      @CooperCodes  2 роки тому

      Thanks I really appreciate that!

  • @getachewsharew5904
    @getachewsharew5904 2 роки тому

    Life Saving.
    God bless you bro.

  • @huzaifac137
    @huzaifac137 Рік тому +2

    Not working it's throwing error google is not defined in the browser and script link is throwing 404 aborted in console

  • @internetdrew
    @internetdrew Рік тому

    A fantastic fix I thought was broken. Make sure to check your extensions for anything that may be aggressively blocking. It wouldn't let me get anything from the gsi link. Disabled the extension: problem solved.

  • @gyalpodongo2438
    @gyalpodongo2438 2 роки тому +1

    Can you also make a video on how to use the authorization part too? I want to add the calendar and gmail API into my application

    • @CooperCodes
      @CooperCodes  2 роки тому +2

      I will look into that for sure, thanks for the idea!

  • @leandromarquez9257
    @leandromarquez9257 2 роки тому +7

    Hi Cooper, What if I need to send an auth code to the backend to get access and refresh tokens ? Should I use another way ?

    • @tanayparashar1487
      @tanayparashar1487 2 роки тому +1

      Any leads on this I need access token for accessing sheets API? Where I can get access token of logged in user?

    • @getachewsharew5904
      @getachewsharew5904 2 роки тому

      why don't you put it on the request header portion.

  • @ankitverma4159
    @ankitverma4159 2 роки тому +3

    Can you please share the link to the documentation that you followed ?

    • @ruben1626
      @ruben1626 Рік тому

      This is the official Google Identity documentation for web: developers.google.com/identity/gsi/web/guides/overview
      He basically goes through the 'get started' and 'sign in with google button' sections.

  • @robertkuchta9244
    @robertkuchta9244 Рік тому

    Thanks for this video, it helped me a lot! Is there a way to persist the logged in state on the page refresh? It was possible in the "old" login method with OAuth2, I wonder if we can achieve the same.

  • @LS_Roblox-DG
    @LS_Roblox-DG 2 роки тому

    Thanks for sharing your valuable experience.

  • @carriep7812
    @carriep7812 Рік тому

    This was awesome! Thanks for putting it out there

  • @johnfox4914
    @johnfox4914 2 роки тому +1

    Well done, thank you for this tutorial.

  • @Evan-Offline
    @Evan-Offline Рік тому

    Hey Cooper - great video! I was wondering how to add api scopes with this method? Thank you!

    • @Evan-Offline
      @Evan-Offline Рік тому +1

      For anyone else looking, most of what I needed was right: ua-cam.com/video/C0DUNy6RjNw/v-deo.html
      This channel is legit - cheers

    • @CooperCodes
      @CooperCodes  Рік тому +1

      Ayo Evan I was legit about to recommend that. Glad you found it yourself :). Thank you for watching and supporting

  • @mikmikdc1297
    @mikmikdc1297 2 роки тому

    lovely video with in depth explanation but 1 question. How does one do the importings

  • @섭지-t5b
    @섭지-t5b 2 роки тому

    i really appreciate it! Exellent tutorial! from korea

  • @goksuokar288
    @goksuokar288 2 роки тому +1

    Hi!! I'm still getting a google not defined error during mounting, how do you fix that??? I put the script in and you can access google object from the console but react will throw an error while rendering (not compiling, I disabled the linter for that) and will not render anything.

  • @ciyaarahadunidaoffical5474
    @ciyaarahadunidaoffical5474 2 роки тому

    in the details. when you get stuck, roll back to the beginning and start over. The other weay is to focus entirely on one set of commands

  • @hassaanhameed9624
    @hassaanhameed9624 Рік тому

    Good tutorial, Thanks a lot, It was simple and concise.

  • @victorpaulguzmansoto5575
    @victorpaulguzmansoto5575 2 роки тому

    Great, I'm lucky, it works great for me without errors

  • @carmelchurchsatchiyapuram2292
    @carmelchurchsatchiyapuram2292 2 роки тому

    you are literally the best

  • @Chase20224
    @Chase20224 2 роки тому

    Thanks! Your video content is the safest and most useful

    • @CooperCodes
      @CooperCodes  2 роки тому

      Thank you! Appreciate the comment and glad it was useful

  • @auditrihumbas177
    @auditrihumbas177 2 роки тому

    Nice tutorial Michael,

  • @realhavir1295
    @realhavir1295 2 роки тому

    Life saving my man, life saving!

  • @shizhanli6765
    @shizhanli6765 2 роки тому +1

    Thanks a lot for your video. Do you know how to judge if a token has expired? I know there is token.exp in old version google login. But I could not find one in new version.

    • @CooperCodes
      @CooperCodes  2 роки тому

      You can just create your own JWT to manage the time you want your login to expire when the Google sends you that successful token. Redux can help you manage multiple things such as your own expiring token alongside the Google information. I am most likely going to do a video on something like Redux soon.
      If you're unfamiliar with creating your own expiring JWTs, take a look at this www.codegrepper.com/code-examples/javascript/how+to+set+expire+time+of+jwt+token+in+node+js
      Hopefully this helps, thanks for your comment.