Introduction
Recently I was building a project in NextJS in which I needed to implement 'Sign in with Google' without third-party librar...
For further actions, you may consider blocking this person and/or reporting abuse
Hey, amazing article! It's helping me with integrating Google Sign-in with my webapp. I had to convert some of the code to Vanilla JavaScript, but that was pretty easy!
I did find a couple of errors in your code (errors at least for me):
code: req.body.code, the code supplied is not inreq.body, instead it is given throughreq.query. It is also important to note that after successful login it redirects to theGETURL, notPOST.oauthResponseData = oauthResponse.data, butoauthResponsedoes not have a childdata. Instead, just useoauthResponse. You can then useid_tokenfromoauthResponselater.Despite these, I found the article very straightforward. It was very easy to use the method to create a login link and get user details, and also sticks with the idea of being dependent-free. Thanks for this one!