-
Notifications
You must be signed in to change notification settings - Fork 5
Add sso #1652
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
base: master
Are you sure you want to change the base?
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds SSO (Single Sign-On) functionality using Google OAuth through Clerk authentication. The changes enable users to sign in with Google accounts and complete their profile through a new SSO callback flow.
- Adds Google OAuth authentication flow to the join page
- Creates SSO callback page for handling OAuth redirects
- Implements user lookup by email functionality
- Adds comprehensive error handling with cleanup for user creation
Reviewed Changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| src/server/api/routers/users/index.ts | Exports new getByEmail procedure |
| src/server/api/routers/users/get.ts | Adds getByEmail query for user lookup by email |
| src/server/api/routers/users/create.ts | Adds error handling with cleanup for failed user creation |
| src/middleware.ts | Updates auth middleware and adds SSO callback route |
| src/app/sso-callback/page.tsx | New SSO callback page for OAuth redirects |
| src/app/profile/[id]/page.tsx | Renames imported component for clarity |
| src/app/profile/[id]/page-content.tsx | Renames component from ProfilePage to ProfilePageContent |
| src/app/not-found.tsx | Adds padding to not found page layout |
| src/app/join/page.tsx | Adds Google OAuth sign-in button and flow |
| src/app/create-account/complete-profile/page.tsx | New comprehensive profile completion page for SSO users |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds Single Sign-On (SSO) support to the application, specifically enabling Google OAuth authentication alongside the existing email-based authentication flow.
- Adds Google OAuth authentication to the login page with redirect handling
- Creates a new SSO callback page to handle OAuth redirects
- Adds a profile completion flow for new SSO users
- Refactors profile page components and updates middleware routing patterns
Reviewed Changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
src/server/api/routers/users/index.ts |
Exports new getByEmail function for user lookup by email |
src/server/api/routers/users/get.ts |
Adds getByEmail procedure to find users by email address |
src/middleware.ts |
Updates protected route patterns and authentication logic |
src/app/sso-callback/page.tsx |
New callback page for handling SSO authentication redirects |
src/app/profile/[id]/page.tsx |
Refactors to use renamed component |
src/app/profile/[id]/page-content.tsx |
Renames component from ProfilePage to ProfilePageContent |
src/app/not-found.tsx |
Adds padding to improve layout |
src/app/join/page.tsx |
Adds Google OAuth signin button and handler |
src/app/create-account/page.tsx |
Minor cleanup of comments and error messages |
src/app/create-account/complete-profile/page.tsx |
New profile completion page for SSO users |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| setLoading(false) | ||
| setStep("email") | ||
| } | ||
| } |
Copilot
AI
Sep 9, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] Missing blank line before function declaration. Add a blank line between the closing brace and the function declaration for consistency with the codebase style.
| } | |
| } |
| redirectUrlComplete: `/dashboard`, // after everything succeeds | ||
| }) | ||
| } catch (error) { | ||
| console.error("Google sign-in failed", error) |
Copilot
AI
Sep 9, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Logging the complete error object to console may expose sensitive information. Consider logging only the error message or using a structured logging approach that filters sensitive data.
| console.error("Google sign-in failed", error) | |
| console.error("Google sign-in failed:", (error as { message?: string })?.message ?? error) |
| } | ||
| window.scrollTo({ | ||
| top: 0, | ||
| behavior: "smooth", // smooth scrolling |
Copilot
AI
Sep 9, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] Remove redundant comment. The comment 'smooth scrolling' simply restates what the code already clearly expresses with behavior: \"smooth\".
| behavior: "smooth", // smooth scrolling | |
| behavior: "smooth", |
Change Summary
[Briefly summarise the changes that you made. Just high-level stuff]


Change Form
Fill this up (NA if not available). If a certain criteria is not met, can you please give a reason.
Other Information
[Is there anything in particular in the review that I should be aware of?]