Skip to content

fix: replace broken GitHub login with Clerk auth#1520

Merged
sanjay-kv merged 5 commits into
recodehive:mainfrom
Abhash-Chakraborty:Abhash/issue-322-clerk-auth
May 16, 2026
Merged

fix: replace broken GitHub login with Clerk auth#1520
sanjay-kv merged 5 commits into
recodehive:mainfrom
Abhash-Chakraborty:Abhash/issue-322-clerk-auth

Conversation

@Abhash-Chakraborty
Copy link
Copy Markdown
Member

Summary

  • remove the retired Firebase auth implementation
  • replace it with Clerk auth in the navbar and protect only the leaderboard view
  • add Clerk env documentation and style the auth modal to match the site
  • clean up the pre-existing TypeScript issues so verification passes again

Testing

  • npm run typecheck
  • npm run build
  • npx clerk doctor --json
  • manually verified signed-out leaderboard gating and Clerk modal rendering locally

Closes #322

Copilot AI review requested due to automatic review settings May 15, 2026 07:22
@vercel
Copy link
Copy Markdown
Contributor

vercel Bot commented May 15, 2026

@Abhash-Chakraborty is attempting to deploy a commit to the recode Team on Vercel.

A member of the Team first needs to authorize it.

@github-actions
Copy link
Copy Markdown

Thank you for submitting your pull request! 🙌 We'll review it as soon as possible. The estimated time for response is 5–8 hrs.

In the meantime, please provide all necessary screenshots and make sure you run - npm build run , command and provide a screenshot, a video recording, or an image of the update you made below, which helps speed up the review and assignment. If you have questions, reach out to LinkedIn. Your contributions are highly appreciated!😊

Note: I maintain the repo issue every day twice at 8:00 AM IST and 9:00 PM IST. If your PR goes stale for more than one day, you can tag and comment on this same issue by tagging @sanjay-kv.

We are here to help you on this journey of open source. Consistent 20 contributions are eligible for sponsorship 💰

🎁 check our list of amazing people we sponsored so far: GitHub Sponsorship. ✨

📚Your perks for contribution to this community 👇🏻

  1. Get free Consultation use code recode50 to get free: Mentorship for free.

  2. Get the Ebook for free use code recode at checkout: Data Science cheatsheet for Beginners.

  3. Check out this weekly Newsletter: Sanjay's Newsletter.

If there are any specific instructions or feedback regarding your PR, we'll provide them here. Thanks again for your contribution! 😊

@github-actions github-actions Bot added in-review The current changes are in review and would need approval and testing before merging level 1 10 points recode this is label for leaderboard labels May 15, 2026
@github-actions github-actions Bot added this to the recode:launch 3.0 milestone May 15, 2026
@github-actions github-actions Bot added area:API REST/HTTP API area:backend-sql for issues related to the experimintal support of MsSql as backend area:dev-env CI, pre-commit, pylint and other changes that do not change the behavior of the final code area:production-image Production image improvements and fixes level 2 30 points labels May 15, 2026
@github-actions
Copy link
Copy Markdown

✅ Synchronized metadata from Issue #322:

  • Labels: area:API, area:dev-env, area:production-image, area:backend-sql, level 2
  • Milestone: recode:launch 3.0

Copy link
Copy Markdown
Contributor

Copilot AI left a 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 replaces the retired Firebase GitHub login flow with Clerk-based authentication in the Docusaurus site, wiring Clerk into the app shell, navbar, and dashboard leaderboard gating.

Changes:

  • Adds Clerk configuration, provider setup, navbar auth UI, and leaderboard sign-in gating.
  • Removes Firebase auth code and dependencies.
  • Updates related TypeScript declarations, styling, and lockfile/package metadata.

Reviewed changes

Copilot reviewed 17 out of 19 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
.env.example Documents Clerk publishable and secret keys.
docusaurus.config.ts Loads local env and exposes Clerk publishable key/custom navbar mount point.
package.json Adds Clerk dependency, removes Firebase packages, updates Node engine.
package-lock.json Updates dependency tree for auth package changes.
src/components/ui/NavbarClerkAuth.tsx Adds Clerk navbar sign-in/user-button portal.
src/components/ui/NavbarFirebaseAuthGithub.tsx Removes Firebase navbar portal.
src/components/ui/FirebaseAuthGithub.tsx Removes Firebase GitHub sign-in component.
src/lib/firebase.ts Removes Firebase initialization.
src/theme/Root.tsx Wraps site content with ClerkProvider when configured.
src/theme/Layout.tsx Swaps Firebase navbar auth for Clerk navbar auth.
src/pages/dashboard/index.tsx Gates leaderboard rendering behind Clerk sign-in.
src/pages/dashboard/dashboard.css Adds styles for leaderboard auth state/button and formatting updates.
src/css/custom.css Updates navbar selectors/styles for Clerk auth control.
src/theme/Navbar/Content/index.tsx Adjusts navbar item key/error handling typing.
src/types/global.d.ts Refines ambient type declarations.
src/pages/merch/index.tsx Adds Framer Motion variant typings.
src/pages/blogs/index.tsx Adds HTMLElement cast for image fallback handling.
src/components/discussions/DiscussionCard.tsx Adds HTMLElement cast for avatar fallback handling.
src/components/blogCarousel/blogCard.tsx Adds HTMLElement cast for image fallback handling.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +3 to +16
import { Show, SignInButton, UserButton } from "@clerk/react";
import { createPortal } from "react-dom";

const NavbarClerkAuthContent: React.FC = () => {
return (
<div className="clerk-navbar-auth">
<Show when="signed-out">
<SignInButton mode="modal">
<button className="clerk-navbar-sign-in">Sign in</button>
</SignInButton>
</Show>
<Show when="signed-in">
<UserButton />
</Show>
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@Abhash-Chakraborty can you look into this

@github-actions
Copy link
Copy Markdown

✅ Synchronized metadata from Issue #322:

  • Labels: area:API, area:dev-env, area:production-image, area:backend-sql, level 2
  • Milestone: recode:launch 3.0

@vercel
Copy link
Copy Markdown
Contributor

vercel Bot commented May 15, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
recode-website Ready Ready Preview, Comment May 15, 2026 10:42am

@sanjay-kv
Copy link
Copy Markdown
Member

@Adez017
I need your review here

Comment on lines +3 to +16
import { Show, SignInButton, UserButton } from "@clerk/react";
import { createPortal } from "react-dom";

const NavbarClerkAuthContent: React.FC = () => {
return (
<div className="clerk-navbar-auth">
<Show when="signed-out">
<SignInButton mode="modal">
<button className="clerk-navbar-sign-in">Sign in</button>
</SignInButton>
</Show>
<Show when="signed-in">
<UserButton />
</Show>
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@Abhash-Chakraborty can you look into this

}

const BlogCard = ({ type, date, title, content, imageUrl, id, authors }) => {
const [isHovered, setIsHovered] = React.useState(false);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

why this changes , can you explain ?

@Adez017
Copy link
Copy Markdown
Member

Adez017 commented May 15, 2026

@Abhash-Chakraborty @sanjay-kv , could you guys confirm we had implemented the correct github sign in ?

@Adez017
Copy link
Copy Markdown
Member

Adez017 commented May 15, 2026

I had made a thorough review and found some changes in blogs , discussions and dashboard cards or css , can you provide any clarification on that ? @Abhash-Chakraborty

@Abhash-Chakraborty
Copy link
Copy Markdown
Member Author

I had made a thorough review and found some changes in blogs , discussions and dashboard cards or css , can you provide any clarification on that ? @Abhash-Chakraborty

The blog, discussion, merch, and dashboard-related edits are small cleanup/type-safety fixes I added while testing the branch, not part of the core auth change.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Refined the blog card to use typed props and shared author helpers, and improved author rendering with linked names plus stacked avatars.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Small cleanup: removed an unused icon import and tightened the image fallback typing so TypeScript can safely handle the DOM element.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Added the new navbar auth component that shows Clerk sign-in when signed out and the user menu when signed in.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Removed this

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Added styles for the leaderboard auth gate state and applied some formatting cleanup to existing dashboard CSS.

@Abhash-Chakraborty
Copy link
Copy Markdown
Member Author

Screen.Recording.2026-05-16.133417.mp4

@Adez017
Copy link
Copy Markdown
Member

Adez017 commented May 16, 2026

Hi @Abhash-Chakraborty , great work but can we keep the same design as we currently have which shows sign in with GitHub with logo

@Adez017
Copy link
Copy Markdown
Member

Adez017 commented May 16, 2026

image @Abhash-Chakraborty something like this

@sanjay-kv sanjay-kv merged commit 768171f into recodehive:main May 16, 2026
6 checks passed
@Abhash-Chakraborty
Copy link
Copy Markdown
Member Author

@sanjay-kv please properly configure prod env in clerk and add variables

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

Labels

area:API REST/HTTP API area:backend-sql for issues related to the experimintal support of MsSql as backend area:dev-env CI, pre-commit, pylint and other changes that do not change the behavior of the final code area:production-image Production image improvements and fixes in-review The current changes are in review and would need approval and testing before merging level 1 10 points level 2 30 points recode this is label for leaderboard

Projects

None yet

Development

Successfully merging this pull request may close these issues.

🐞[Bug]: GitHub Login is not working

4 participants