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

feat: ✨ implement google oauth #27

Merged
merged 10 commits into from
Feb 9, 2024
Merged

feat: ✨ implement google oauth #27

merged 10 commits into from
Feb 9, 2024

Conversation

KevinWu098
Copy link
Member

@KevinWu098 KevinWu098 commented Feb 1, 2024

Summary

  1. Implements Google OAuth using the email property of a GoogleUser as the userId.
  2. Sets all new users to be created with email as the id

OAuth Demo

Testing

Since I'm using my personal Google OAuth keys, please test locally:

Current list of tester accounts:

env keys:

  • Check #zotmeet-internal on Discord

Process

Working off a variety of resources with varying efficacies:

Issues

Closes #23

To-Do

  • Make it less scuffed (using email as user id rn 💀 )

@KevinWu098 KevinWu098 temporarily deployed to staging-27 February 1, 2024 09:05 — with GitHub Actions Inactive
@KevinWu098 KevinWu098 temporarily deployed to staging-27 February 1, 2024 09:36 — with GitHub Actions Inactive
@KevinWu098 KevinWu098 temporarily deployed to staging-27 February 1, 2024 09:39 — with GitHub Actions Inactive
@KevinWu098 KevinWu098 temporarily deployed to staging-27 February 1, 2024 09:42 — with GitHub Actions Inactive
@KevinWu098 KevinWu098 temporarily deployed to staging-27 February 2, 2024 00:22 — with GitHub Actions Inactive
Comment on lines +13 to +15
if (dbUser) {
return dbUser;
}
Copy link
Member

Choose a reason for hiding this comment

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

This should be outside of the try block

Copy link
Member Author

Choose a reason for hiding this comment

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

This is a weird... quirk of Lucia (?) where auth.getUser() raises an error when passed a key not in the database.

The try block allows for a "quiet" handling of the not found case. I've attempted to find an alternate solution, but this piece of code isn't particularly offensive to me.

I can hunt down an alternate solution if you'd pref.

Copy link
Member

@MinhxNguyen7 MinhxNguyen7 left a comment

Choose a reason for hiding this comment

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

Everything looks good other than the minor suggestions.

I haven't been able to test it locally because of how I run the development server, but just show me it working on your machine, and I'll take your word for it

Copy link
Member

@MinhxNguyen7 MinhxNguyen7 left a comment

Choose a reason for hiding this comment

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

LGTM!

@KevinWu098 KevinWu098 temporarily deployed to staging-27 February 9, 2024 00:36 — with GitHub Actions Inactive
Copy link
Member

@MinhxNguyen7 MinhxNguyen7 left a comment

Choose a reason for hiding this comment

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

LGTM!

@MinhxNguyen7 MinhxNguyen7 merged commit 9cdb339 into main Feb 9, 2024
1 of 2 checks passed
@KevinWu098 KevinWu098 deleted the 23-google-auth branch October 17, 2024 17:57
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.

Google Auth
2 participants