[Finishes #187355101] User Login By Google #36
Merged
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.
What does this PR do?
This PR allows User to Register and Sign in By Using Google
Description of Task to be completed?
The Task was creating the feature which allows user to Register By using the Google api Aouth2, Passport JS and user will be able to login by using The google
How should this be manually tested?
1.Install the required Packages
2.Set the node environments as .env.example
3. visit https://console.cloud.google.com/ for creating the the project
4. for this for getting started and creating the credentials: https://www.passportjs.org/packages/passport-google-oauth20/
when you successful created credentials, use the browser to visit :
http://127.0.0.1:8000/auth/
, then registerafter that, you might need to return to that page, when you click register again, you will receive the Token to be used:
{"message":"User signed in!","userToken":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOiI2YWQxZjBkYS1lMGNiLTRlNDYtOTUyNy1jYjY2MThhZmRmN2MiLCJmaXJzdE5hbWUiOiJJU0hJTVdFIiwibGFzdE5hbWUiOiJDaHJpc3RpYW4iLCJyb2xlIjoidXNlciIsImlhdCI6MTcxMzMzNTY2MCwiZXhwIjoxNzEzOTQwNDYwfQ.0Tzq5QYq5ltEkKMosY23v_iysp6q1l5htskn4R54UUM"}
copy that bearer Token, and use it in testing in Postman on this endpoint:
http://127.0.0.1:8000/users/profile
What are the relevant pivotal tracker/Trello stories?
My Story tracker: #187355101
### NOTE:
Make sure to use the callback within google console as:
http://127.0.0.1:8000/auth/google/callback
Use the PORT of 8000