Implemented Google Sign-in/Log-in Functionality #7
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Resolves #5
Google API Integration
GOOGLE_CLIENT_ID
andGOOGLE_CLIENT_SECRET
from Google Developer Console and place it in.env
User Interface
Backend Changes
auth.js
file with aGoogleStrategy
to verify and handle data sent by the Google APIgoogleId
, it will create a new account for the userUser Data Handling
googleId
field to theUserSchema
to store a unique identifier for a Google account.googleId
will be used to verify the user instead of name/password.name
field in the database.*Acquiring GOOGLE_CLIENT_ID and GOOGLE_CLIENT_SECRET
Step 3 from the article you provided from the issue was helpful, but doesn't provide all the steps needed to be done.
Prior to following steps outlined in the article head to Google Cloud Console and :
../auth/userinfo.profile
scope to acquire profile information (contains profile id that will be stored ingoogleId
)Now Step 3 outlined in the article can be followed to acquire the
GOOGLE_CLIENT_ID and GOOGLE_CLIENT_SECRET
http://localhost:3000
to the Authorised JavaScript origins sectionFinally add values to
.env
file.