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

[Backend] Implement Google OAuth #21

Merged
merged 13 commits into from
Apr 30, 2024
Merged

[Backend] Implement Google OAuth #21

merged 13 commits into from
Apr 30, 2024

Conversation

rasouza
Copy link
Collaborator

@rasouza rasouza commented Apr 27, 2024

Implement Google login for authentication between Mobile App and API

New URLs:

  • GET /api/auth/google
  • POST /api/auth/google/callback

Description

  • Implement Google strategy in passport.js
  • Add proper env vars for Google OAuth client config
  • Implement JWT authentication

Motivation and Context

Mobile app needs to know which user is logged in so that it can save movies in watchlists and manage subscriptions

This PR implements a JWT auth system that can receive login from Google provider. Now that the auth system is in place, it's easy to add new providers by just implementing each Strategy

How Has This Been Tested?

  • Unit tests
  • Integration tests

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@rasouza rasouza requested a review from mathiasberggren April 28, 2024 17:25
@rasouza rasouza self-assigned this Apr 28, 2024
@rasouza rasouza marked this pull request as ready for review April 28, 2024 17:26
@@ -11,7 +11,7 @@
"dev": "vite",
"start:debug": "nest start --debug --watch",
"start:prod": "node dist/main",
"console": "yarn start -- --watch --entryFile repl",
Copy link
Owner

Choose a reason for hiding this comment

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

I feel like I'm swapping between yarn and npm, but I guess we're using npm now? 😃

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

hahaha sorry I should have left a note here.. yarn was failing to capture the terminal session when using the REPL. For some reason, running this command specifically with npm works and I didn't want to put effort to investigate why and fix it.

We're definitely using yarn and you should still run yarn console

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Let's keep a proper ticket here :D #23

@rasouza rasouza merged commit 2c057f4 into main Apr 30, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants