Skip to content

implemented the google OAuth authentication #307

Open
saurabh19304 wants to merge 1 commit into
Priyanshu-byte-coder:mainfrom
saurabh19304:feat/add-google-oauth
Open

implemented the google OAuth authentication #307
saurabh19304 wants to merge 1 commit into
Priyanshu-byte-coder:mainfrom
saurabh19304:feat/add-google-oauth

Conversation

@saurabh19304
Copy link
Copy Markdown
Contributor

@saurabh19304 saurabh19304 commented May 17, 2026

Summary

Added Google OAuth sign-in support alongside existing GitHub login with a clean dedicated sign-in page.

Closes #122

Type of Change

  • New feature google authentication with better UI fix

Changes Made

  • Updated src/lib/auth.ts to include Google Provider
  • Updated src/app/page.tsx with a single "Sign In to Continue" button
  • Created new src/app/signin/page.tsx with both GitHub and Google sign-in options
  • Added proper environment variables support for Google OAuth

How to Test

  1. Go to homepage → Click "Sign In to Continue"
  2. On sign-in page, test both:
    • Sign in with GitHub (should still work)
    • Sign in with Google (new)
  3. Verify successful redirect to dashboard after login
  4. Check that existing functionality is not broken

Checklist

  • Google login works
Screenshot 2026-05-18 031254 Screenshot 2026-05-18 031254
  • GitHub login still works
  • No TypeScript errors
  • npm run lint passes
  • Self-reviewed the code

Ready for review.

@vercel
Copy link
Copy Markdown

vercel Bot commented May 17, 2026

@saurabh19304 is attempting to deploy a commit to the PRIYANSHU DOSHI's projects Team on Vercel.

A member of the Team first needs to authorize it.

Copy link
Copy Markdown
Owner

@Priyanshu-byte-coder Priyanshu-byte-coder left a comment

Choose a reason for hiding this comment

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

Google OAuth integration approach is correct (GoogleProvider added, env vars, signin route). Two issues:

1. Hardcoded colors in src/app/signin/page.tsx
The signin page uses hardcoded Tailwind colors that break theming:

// ❌ Hardcoded
bg-gradient-to-br from-slate-950 to-slate-900
bg-slate-800/50 backdrop-blur-md
border-slate-700/50
text-slate-400

// ✅ Use CSS vars
bg-[var(--background)]
bg-[var(--card)]
border-[var(--border)]
text-[var(--muted-foreground)]

2. Missing rel="noopener noreferrer" on page.tsx GitHub link — the existing link in page.tsx already has it, but double-check yours does too.

Also note the landing page changes in page.tsx have a trailing whitespace issue and a blank line before the closing brace. Minor but worth cleaning up.

@Priyanshu-byte-coder
Copy link
Copy Markdown
Owner

Google OAuth sign-in page is a nice idea, but there are blockers:

1. Google provider not configuredauthOptions in src/lib/auth.ts only has the GitHub provider. Adding signIn("google", ...) without registering the provider in authOptions will throw a No provider found for google error. Please add:

// In authOptions.providers:
GoogleProvider({
  clientId: process.env.GOOGLE_ID!,
  clientSecret: process.env.GOOGLE_SECRET!,
})

And document the required env vars (GOOGLE_ID, GOOGLE_SECRET) in .env.example.

2. Hardcoded colors in page.tsx:

  • bg-blue-600 text-white hover:bg-blue-700bg-[var(--accent)] text-[var(--accent-foreground)] hover:opacity-90
  • text-slate-400 hover:text-slate-300text-[var(--muted-foreground)] hover:text-[var(--foreground)]

Fix these and push — the sign-in page concept is solid once the provider is wired up.

@saurabh19304
Copy link
Copy Markdown
Contributor Author

Will fix rhe issues and come back to you

Copy link
Copy Markdown
Owner

@Priyanshu-byte-coder Priyanshu-byte-coder left a comment

Choose a reason for hiding this comment

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

The GoogleProvider configuration in auth.ts is correct. Two issues:

1. Rebase required
PR has merge conflicts with main (auth.ts and page.tsx were modified by other merged PRs). Rebase and resolve conflicts before re-review.

2. Hardcoded colors throughout signin/page.tsx
The sign-in page uses entirely hardcoded dark palette:

  • bg-gradient-to-br from-slate-950 to-slate-900bg-[var(--background)]
  • bg-slate-800/50, border-slate-700/50bg-[var(--card)] border-[var(--border)]
  • text-white, text-slate-300, text-slate-400text-[var(--foreground)], text-[var(--muted-foreground)]
  • GitHub button: bg-white text-slate-900 hover:bg-slate-100bg-[var(--card)] text-[var(--card-foreground)] hover:bg-[var(--control)]

This page would look broken in light mode (dark text on dark background) since the colors are hardcoded for dark theme only.

Also add GOOGLE_CLIENT_ID and GOOGLE_CLIENT_SECRET to .env.example (with placeholder values).

Copy link
Copy Markdown
Owner

@Priyanshu-byte-coder Priyanshu-byte-coder left a comment

Choose a reason for hiding this comment

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

1. Google users get 401 everywhere — the signIn callback only upserts to DB for provider === "github". Google users have no DB record and no githubId in their session, so every API route returns 401. The feature is non-functional — users can sign in but cannot use the dashboard at all.

2. Hardcoded colors in signin/page.tsxbg-gradient-to-br from-slate-950 to-slate-900, text-slate-400, text-white throughout. Use CSS vars.

3. Broken SVG path — the GitHub icon path data has v 3.293c0 (space between v and the value) — invalid path syntax.

4. Missing EOF newlines on page.tsx and auth.ts.

5. No env var docs — add GOOGLE_CLIENT_ID and GOOGLE_CLIENT_SECRET to .env.example.

@Priyanshu-byte-coder Priyanshu-byte-coder added level:advanced GSSoC: Advanced difficulty (55 pts) gssoc26 GSSoC 2026 contribution type:feature GSSoC type bonus: new feature type:security GSSoC type bonus: security (+20 pts) labels May 20, 2026
Copy link
Copy Markdown
Owner

@Priyanshu-byte-coder Priyanshu-byte-coder left a comment

Choose a reason for hiding this comment

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

Issues found in this PR:

  • Missing EOF newline — add a trailing newline to all modified files.

@Priyanshu-byte-coder Priyanshu-byte-coder added the gssoc:approved GSSoC: PR approved for scoring label May 24, 2026
@Priyanshu-byte-coder
Copy link
Copy Markdown
Owner

This PR has merge conflicts with main. Please rebase on the latest main branch and re-request review. The approach is approved — just needs conflict resolution.

@Priyanshu-byte-coder
Copy link
Copy Markdown
Owner

This PR has conflicts with the current main branch. Please rebase on main to resolve conflicts so it can be reviewed and merged. Run: git fetch upstream main && git rebase upstream/main

Copy link
Copy Markdown
Owner

@Priyanshu-byte-coder Priyanshu-byte-coder left a comment

Choose a reason for hiding this comment

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

This PR has merge conflicts with main. Please rebase onto the latest main branch and resolve conflicts to proceed with merging.

@Priyanshu-byte-coder
Copy link
Copy Markdown
Owner

This PR has merge conflicts with main. Please rebase your branch against the latest main and force-push to resolve. Run: git fetch upstream && git rebase upstream/main

@Karanjot786
Copy link
Copy Markdown

Hey @saurabh19304! Saw your work on GSSoC 2026.

We are building TermUI, a TypeScript terminal UI framework with React-style hooks and JSX, rendered entirely in the terminal.

We have 55 unassigned GSSoC issues open, including new widgets, hooks, and CLI tooling. Your TypeScript background transfers directly.

Karanjot, TermUI maintainer

@Priyanshu-byte-coder
Copy link
Copy Markdown
Owner

This PR has merge conflicts with main. Please rebase:

git fetch origin
git rebase origin/main
# fix conflicts, then:
git push --force-with-lease

@Priyanshu-byte-coder
Copy link
Copy Markdown
Owner

This PR has merge conflicts with the current main branch. Please rebase on the latest main to resolve them — your contribution is labeled for GSSoC scoring.

@Priyanshu-byte-coder
Copy link
Copy Markdown
Owner

Thanks for the PR! A few design concerns before we can consider this:

  1. Architectural mismatch: DevTrack is a GitHub-centric productivity tool — all features (commit streaks, PR analytics, contribution heatmaps) require a GitHub access token. A Google OAuth user would have a valid session but no way to access any GitHub data. The app would be effectively broken for them.

  2. Conflicts: src/lib/auth.ts was recently refactored in fix(auth): add rate limiting for authentication endpoints #1940 (auth rate limiting). This PR needs a rebase.

  3. Missing scope: If the goal is supporting non-GitHub users, a PR of this scope also needs: (a) updated UI to explain the GitHub data requirement, (b) a post-Google-sign-in flow to link a GitHub account, and (c) a database migration to decouple user identity from GitHub ID.

This would be a good candidate to discuss first in a GitHub Discussion or Issue before implementing.

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

Labels

gssoc:approved GSSoC: PR approved for scoring gssoc26 GSSoC 2026 contribution level:advanced GSSoC: Advanced difficulty (55 pts) type:feature GSSoC type bonus: new feature type:security GSSoC type bonus: security (+20 pts)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants