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: connect/disconnect to/from google #2221

Merged
merged 3 commits into from
Nov 28, 2023
Merged

Conversation

blushi
Copy link
Member

@blushi blushi commented Nov 22, 2023

Description

Closes: #2211


Author Checklist

All items are required. Please add a note to the item if the item is not applicable and
please add links to any relevant follow up issues.

I have...

  • provided a link to the relevant issue or specification
  • provided instructions on how to test
  • reviewed "Files changed" and left comments if necessary
  • confirmed all CI checks have passed

How to test

Go to https://deploy-preview-2221--regen-marketplace.netlify.app/ and log in.
Go to the settings page and try connecting/disconnect to/from google.

Reviewers Checklist

All items are required. Please add a note if the item is not applicable and please add
your handle next to the items reviewed if you only reviewed selected items
.

I have...

  • confirmed all author checklist items have been addressed
  • reviewed code correctness and readability
  • verified React components follow DRY principles
  • reviewed documentation is accurate
  • reviewed tests
  • manually tested (if applicable)

@blushi blushi requested a review from a team November 22, 2023 13:01
Copy link

netlify bot commented Nov 22, 2023

Deploy Preview for regen-website ready!

Name Link
🔨 Latest commit dfa81ce
🔍 Latest deploy log https://app.netlify.com/sites/regen-website/deploys/6565aab3b1bc7900083480a5
😎 Deploy Preview https://deploy-preview-2221--regen-website.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@blushi
Copy link
Member Author

blushi commented Nov 22, 2023

@erikalogie see testing instructions above.
Best to use a google account that hasn't been used yet, otherwise you'll get a server error because the google account is already used by another account.

@erikalogie
Copy link
Collaborator

@blushi I'm getting this when I first log in with my email and navigate to the settings. These two things should be congruent (there should be a connect button not a disconnect button) https://monosnap.com/file/uvg5HJuextai7Wec0lSmHjI5uvTH9j

@erikalogie
Copy link
Collaborator

@blushi I'm having trouble connecting with google

Screen.Recording.2023-11-22.at.11.48.57.AM.mov

@aaronc
Copy link
Member

aaronc commented Nov 22, 2023

I tried connecting to google and just get this:
image

@blushi
Copy link
Member Author

blushi commented Nov 23, 2023

I tried connecting to google and just get this: image

It looks as if you were not logged in (only logged in users can connect an account to google, hence the unauthorized error: https://github.com/regen-network/regen-server/blob/fd79a95da729e64ef2e98d5340d89abc80fe376a/server/routes/auth.ts#L41). Could you describe how you logged in before trying to connect to google? which browser are you using?

@blushi
Copy link
Member Author

blushi commented Nov 23, 2023

@blushi I'm getting this when I first log in with my email and navigate to the settings. These two things should be congruent (there should be a connect button not a disconnect button) https://monosnap.com/file/uvg5HJuextai7Wec0lSmHjI5uvTH9j

Looks like this might be a one-time issue based on the recent database migration for adding a specific google_email that can be different from the main email. This should not happen again.

@blushi
Copy link
Member Author

blushi commented Nov 23, 2023

I tried connecting to google and just get this: image

It looks as if you were not logged in (only logged in users can connect an account to google, hence the unauthorized error: https://github.com/regen-network/regen-server/blob/fd79a95da729e64ef2e98d5340d89abc80fe376a/server/routes/auth.ts#L41). Could you describe how you logged in before trying to connect to google? which browser are you using?

Nevermind, I could reproduce it using Brave so I'll investigate.

@blushi
Copy link
Member Author

blushi commented Nov 23, 2023

@erikalogie @aaronc it looks like this is because Brave blocks inter-domain cookies by default (which is the case for deploy previews which have a different domain than the server, it should work fine on https://dev.app.regen.network/), even if they are set as Secure like it's the case here in staging. In order to test google connect on deploy previews, you will need to go to the Brave Shields settings and authorize all cookies for the deploy preview.

@erikalogie
Copy link
Collaborator

@erikalogie @aaronc it looks like this is because Brave blocks inter-domain cookies by default (which is the case for deploy previews which have a different domain than the server, it should work fine on https://dev.app.regen.network/), even if they are set as Secure like it's the case here in staging. In order to test google connect on deploy previews, you will need to go to the Brave Shields settings and authorize all cookies for the deploy preview.

This is working for me now!

Copy link
Collaborator

@flagrede flagrede left a comment

Choose a reason for hiding this comment

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

Looks good!
One minor comment.

@blushi blushi merged commit fd541ad into dev Nov 28, 2023
11 checks passed
@blushi blushi deleted the feat-2211-connect-google branch November 28, 2023 09:26
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.

Implement the google connect/disconnect flow
4 participants