Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Finishes #187355101] User Login By Google #36

Merged
merged 1 commit into from
May 20, 2024
Merged

Conversation

Christian-Ishimwe
Copy link
Contributor

@Christian-Ishimwe Christian-Ishimwe commented May 10, 2024

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 register
after 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

Screenshot 2024-05-10 084638

Copy link

render bot commented May 10, 2024

Copy link

render bot commented May 10, 2024

src/config/google.auth.ts Show resolved Hide resolved
src/config/jwt.token.ts Show resolved Hide resolved
src/docs/Users/googleAuth.ts Show resolved Hide resolved
src/routes/Auth.ts Show resolved Hide resolved
@pacifiquemboni pacifiquemboni self-requested a review May 10, 2024 14:17
Copy link

render bot commented May 13, 2024

Copy link
Collaborator

@UmuhireJessie UmuhireJessie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good work @Christian-Ishimwe, please squash the commits

src/tests/jwt.test.ts Show resolved Hide resolved
@UmuhireJessie UmuhireJessie merged commit 2dff869 into develop May 20, 2024
4 of 5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants