Welcome email, login and my account pages to handle workspaces#22
Welcome email, login and my account pages to handle workspaces#22
Conversation
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
✅ Deploy Preview for mongoose-js ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
There was a problem hiding this comment.
Pull request overview
This pull request implements workspace-based authentication and onboarding for Mongoose Studio. When users purchase a subscription via Stripe, they receive a welcome email with a setup link that allows them to log in via GitHub or Google OAuth and claim ownership of their workspace. The PR also adds account management pages where users can view their workspaces, see API keys, and update workspace names.
Changes:
- Added Stripe webhook handling to create workspaces, send welcome emails with setup links, and rotate API keys upon subscription creation
- Implemented login and account management pages with OAuth integration that matches users to workspaces based on email
- Enhanced GitHub OAuth to retrieve primary email addresses and match users to workspace invitations by email
Reviewed changes
Copilot reviewed 19 out of 21 changed files in this pull request and generated 15 comments.
Show a summary per file
| File | Description |
|---|---|
| test/verifyGithubAccessToken.test.js | Minor formatting fix: removed space before parentheses in arrow function |
| test/updateWorkspaceMember.test.js | Fixed test to use 'roles' array instead of singular 'role' to match API |
| test/stripeWebhook.test.js | Added comprehensive tests for Stripe webhook handling including workspace creation and email sending |
| src/util/error.js | New IntegrationError class for handling integration-specific errors with status codes |
| src/integrations/mailgun.js | New Mailgun integration for sending transactional emails with form-data support |
| src/integrations/githubOAuth.js | Added getPrimaryEmail function to fetch user's primary email from GitHub API |
| src/emailTemplates/newWorkspace.html | HTML email template for welcoming new workspace owners with setup instructions |
| src/db/workspace.js | Added stripeCustomerEmail field to temporarily store customer email before workspace is claimed |
| src/db/user.js | Fixed missing semicolon in validation error message |
| src/db/invitation.js | Minor formatting fix: removed space before parentheses in post-validate hook |
| src/actions/updateWorkspace.js | New action to allow owners/admins to update workspace names with validation |
| src/actions/stripeWebhook.js | Major update to handle checkout completion: creates workspaces, generates API keys, and sends setup emails |
| src/actions/getMyAccount.js | New action to retrieve user account info and associated workspaces with roles |
| public/my-account.html | New account dashboard page showing user's workspaces with API key management and name editing |
| public/login.html | New login page that handles OAuth flows and workspace setup via query parameters |
| package.json | Added random-word-slugs dependency and changed mongoose version from pre-release to stable |
| netlify/functions/updateWorkspace.js | Serverless function wrapper for updateWorkspace action |
| netlify/functions/google.js | Added logic to match users to workspaces by stripeCustomerEmail |
| netlify/functions/github.js | Enhanced to fetch primary email and match users to invitations/workspaces by email |
| netlify/functions/getMyAccount.js | Serverless function wrapper for getMyAccount action |
| .env.test | Added environment variables for Stripe, GitHub, and Mailgun in test environment |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
No description provided.