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

Document Google OAuth scopes required #9657

Merged
merged 4 commits into from
Jan 21, 2025
Merged

Conversation

curiousercreative
Copy link
Contributor

Attempts to resolve #9656

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

PR Summary

Added documentation for required Google OAuth scopes in the self-hosting setup guide, helping users properly configure their Google Cloud projects for Gmail and Calendar integration.

  • Added new 'Configure Scopes' section in /packages/twenty-website/src/content/developers/self-hosting/setup.mdx listing required scopes: calendar.events, gmail.readonly, profile.emails.read
  • Included link to source code implementation for scope configuration
  • Placed scopes documentation strategically after API enablement section for logical setup flow

💡 (2/5) Greptile learns from your feedback when you react with 👍/👎!

1 file(s) reviewed, 1 comment(s)
Edit PR Review Bot Settings | Greptile

Comment on lines 43 to 44
### Configure Scopes
[See relevant source code](https://github.com/twentyhq/twenty/blob/main/packages/twenty-server/src/engine/core-modules/auth/utils/get-google-apis-oauth-scopes.ts#L4-L10)
Copy link
Contributor

Choose a reason for hiding this comment

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

style: The source code link should include a description of what users will find there, e.g. 'See source code for full OAuth scope implementation'

@guillim
Copy link
Contributor

guillim commented Jan 16, 2025

Hi @curiousercreative ,

Thanks for contributing. It's a good catch, we forgot to list the permission in the doc !

From what I see, you are missing the permission 'email' and 'profile', am I right ? I get that from reading the file auth/utils/get-google-apis-oauth-scopes.ts

Second request, as you can see in the main branch, we are now working on Microsoft. Can I ask you to add the equivalent paragraph on the "For Outlook and Outlook Calendar (Microsoft 365)" part ? the microsoft scopes are listed here /auth/utils/get-microsoft-apis-oauth-scopes.ts

@curiousercreative
Copy link
Contributor Author

curiousercreative commented Jan 16, 2025

@guillim

  1. Yes, I omitted 'email' and 'profile' due to some confusion. I did not find those exact scopes, perhaps they have changed to 'auth/userinfo.profile' and 'auth/userinfo.email'? These are the scopes I added in my project at least, but I haven't tested whether the presence of these scopes matters or not.
  2. Sure, can do.

@curiousercreative
Copy link
Contributor Author

@guillim added Microsoft scopes. In case you know and want to keep creeping, the documentation around the "cron jobs" could also be improved. At least one of these commands failed (does not exist or similar) and we could answer the question of "when do I need to do this?". Answer could be "once per install (as long as database is alive)", "once per container creation", or "once per container run".

@guillim
Copy link
Contributor

guillim commented Jan 20, 2025

@guillim added Microsoft scopes. In case you know and want to keep creeping, the documentation around the "cron jobs" could also be improved. At least one of these commands failed (does not exist or similar) and we could answer the question of "when do I need to do this?". Answer could be "once per install (as long as database is alive)", "once per container creation", or "once per container run".

Good points.

  • I fixed last week the commend missing (it was a typo on event that was supposed to be events If my memory is correct) but let me know if the error still exists : i will look at it again if you still see it today !
  • "when do I need to do this?" that's a good suggestion. Your answer is almost correct : "As long as redis is alive" We could add a sentence like "You need to run these command every time your restart your redis instance" below the paragraph. What do you think ?

Copy link
Contributor

@guillim guillim left a comment

Choose a reason for hiding this comment

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

To be honest, let's merge your PR as such. For the topics leftover (the one we discussed above) please open a new PR :)

@guillim guillim merged commit e82d4d9 into twentyhq:main Jan 21, 2025
30 checks passed
Copy link

Fails
🚫

node failed.

Log

�[31mError: �[39m SyntaxError: Unexpected token C in JSON at position 0
    at JSON.parse (<anonymous>)
�[90m    at parseJSONFromBytes (node:internal/deps/undici/undici:5584:19)�[39m
�[90m    at successSteps (node:internal/deps/undici/undici:5555:27)�[39m
�[90m    at fullyReadBody (node:internal/deps/undici/undici:1665:9)�[39m
�[90m    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)�[39m
�[90m    at async specConsumeBody (node:internal/deps/undici/undici:5564:7)�[39m
danger-results://tmp/danger-results-2c141e68.json

Generated by 🚫 dangerJS against 670f357

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Document Google OAuth scopes for self-hosted setup
3 participants