Skip to content

[SPRINT-M25] removed manual signup#210

Merged
harshitap1305 merged 1 commit intoOpenLake:mainfrom
harshitap1305:remove-manual-signup
Dec 20, 2025
Merged

[SPRINT-M25] removed manual signup#210
harshitap1305 merged 1 commit intoOpenLake:mainfrom
harshitap1305:remove-manual-signup

Conversation

@harshitap1305
Copy link
Copy Markdown
Member

@harshitap1305 harshitap1305 commented Dec 20, 2025

Closes #186

@vercel
Copy link
Copy Markdown

vercel bot commented Dec 20, 2025

@harshitap1305 is attempting to deploy a commit to the openlake's projects Team on Vercel.

A member of the Team first needs to authorize it.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Dec 20, 2025

Walkthrough

The registration component has been streamlined to remove form-based authentication logic, retaining only Google sign-up functionality. Concurrently, the achievements endorsement component transitions from a simple card layout to a responsive grid structure with integrated error display and improved card organization.

Changes

Cohort / File(s) Summary
Auth Registration Simplification
frontend/src/Components/Auth/Register.jsx
Removed form submission logic, state management, and input fields for name, ID, email, and password. Retained Google sign-up button with updated styling. Eliminated imports for context, navigation, and validation utilities. Simplified surrounding layout and text guidance.
Achievements Grid Restructuring
frontend/src/Components/GenSec/AchievementsEndorsementTab.jsx
Converted single-column layout to responsive grid container. Reintroduced per-achievement card rendering (title, description, user/event details, date, certificate link). Added inline error display block and preserved Endorse button functionality within each card.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

  • Register.jsx: Verify all removed form logic (validation, state, submission handlers) doesn't affect downstream components or authentication flow
  • AchievementsEndorsementTab.jsx: Confirm grid layout responsive behavior and that error display doesn't obscure card content; test Endorse button functionality within new grid context

Poem

🐰 ✨ A form once grand now sleeps in light,
Just Google's glow shines pure and bright!
And grids of wins in rows now dance,
With errors shown at just a glance.
Clean simplicity—our craft takes flight!

Pre-merge checks and finishing touches

❌ Failed checks (2 warnings)
Check name Status Explanation Resolution
Description check ⚠️ Warning No pull request description was provided; the PR is missing all required sections including Related Issue, Changes Introduced, Why This Change, Testing, Documentation Updates, and Checklist. Provide a complete PR description following the template with sections covering related issues, changes introduced, problem/solution/impact, testing performed, and deployment notes.
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (1 passed)
Check name Status Explanation
Title check ✅ Passed The title '[SPRINT-M25] removed manual signup' accurately describes the main change: removing manual signup functionality from the Register component.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Dec 20, 2025

Note

Docstrings generation - SUCCESS
Generated docstrings for this pull request at #211

coderabbitai bot added a commit that referenced this pull request Dec 20, 2025
Docstrings generation was requested by @harshitap1305.

* #210 (comment)

The following files were modified:

* `frontend/src/Components/Auth/Register.jsx`
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
frontend/src/Components/Auth/Register.jsx (1)

5-79: Verify backend validation and Login component still provide necessary alternatives.

The frontend cleanup is complete with no remaining references to registerUser, isIITBhilaiEmail, or manual form submission handlers. Ensure:

  1. Login component (frontend/src/Components/Auth/Login.jsx) provides the expected authentication flow and error handling
  2. Backend removed @iitbhilai.ac.in email domain validation if it was previously enforced on registration
  3. Documentation/help text clarifies that signup now requires a Google account (removes institutional-only restriction)
🧹 Nitpick comments (1)
frontend/src/Components/GenSec/AchievementsEndorsementTab.jsx (1)

140-145: Validate date before formatting to prevent invalid date strings.

If ach.date_achieved is null, undefined, or an invalid date string, format() may produce "Invalid Date" or throw an error. Add validation before formatting.

🔎 Proposed fix
                <div className="flex items-center gap-2">
                  <Calendar className="w-4 h-4 text-gray-500 flex-shrink-0" />
                  <span>
-                    {format(new Date(ach.date_achieved), "dd MMM yyyy")}
+                    {ach.date_achieved 
+                      ? format(new Date(ach.date_achieved), "dd MMM yyyy")
+                      : "Date not available"}
                  </span>
                </div>
📜 Review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 5d9f881 and f34e407.

📒 Files selected for processing (2)
  • frontend/src/Components/Auth/Register.jsx (2 hunks)
  • frontend/src/Components/GenSec/AchievementsEndorsementTab.jsx (1 hunks)
🔇 Additional comments (8)
frontend/src/Components/GenSec/AchievementsEndorsementTab.jsx (3)

115-121: LGTM: Responsive grid layout.

The responsive grid structure (1 column on mobile, 2 on tablet, 3 on desktop) is well-implemented and provides good UX across devices.


146-158: LGTM: Secure external link handling.

The certificate link properly uses rel="noopener noreferrer" with target="_blank" to prevent security vulnerabilities and includes appropriate hover styling.


163-170: LGTM: Proper button state management.

The endorse button correctly manages per-item loading state using the Set-based verifying state, with appropriate disabled styling and loading feedback.

frontend/src/Components/Auth/Register.jsx (5)

1-4: LGTM! Clean import structure.

The import cleanup correctly removes all unused dependencies (React hooks, context, navigation, toast notifications) while retaining only what's needed for the simplified Google-only authentication flow.


32-41: LGTM! Appropriate styling adjustments.

The increased padding (p-12) and refined box-shadow enhance the visual presentation of the simplified registration form.


59-68: LGTM! Clear call-to-action for existing users.

The login link section provides a clear path for existing users with appropriate styling and spacing.


71-76: LGTM! Clear branding section.

The CoSA logo and branding section is well-structured with an improved comment for clarity.


45-57: Use semantic HTML structure and verify OAuth error handling.

Nesting a button inside an anchor tag is not recommended. Styling an anchor to look like a button might mislead users who expect certain keyboard interactions, and overriding semantic elements can introduce accessibility barriers. The anchor tag should directly contain the button styles, or refactor to use an <a> element styled as a button.

Frontend error handling is missing: if the backend OAuth endpoint is unreachable or if the OAuth flow fails, users receive no feedback. Add a try-catch wrapper or error boundary to catch navigation errors and provide user guidance.

Ensure the backend OAuth implementation includes CSRF protection via state parameter validation, which is highly recommended. When using Passport.js, state generation and validation should be handled automatically if properly configured. Verify the backend strategy includes the state: true option and failureRedirect for error handling.

Comment on lines +109 to +113
{error && (
<div className="bg-red-50 border border-red-200 rounded-md p-4">
<p className="text-red-800">{error}</p>
</div>
)}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Remove unreachable error display.

The error block at lines 109-113 is unreachable dead code. When error is truthy, the component returns early at lines 83-89, so this inline error display will never render.

🔎 Proposed fix
  return (
    <div className="space-y-6 w-full">
-      {error && (
-        <div className="bg-red-50 border border-red-200 rounded-md p-4">
-          <p className="text-red-800">{error}</p>
-        </div>
-      )}
-
      <div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6 w-full">
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
{error && (
<div className="bg-red-50 border border-red-200 rounded-md p-4">
<p className="text-red-800">{error}</p>
</div>
)}
return (
<div className="space-y-6 w-full">
<div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6 w-full">
🤖 Prompt for AI Agents
In frontend/src/Components/GenSec/AchievementsEndorsementTab.jsx around lines
109 to 113, the inline JSX block that renders the error banner is unreachable
because the component already returns early when error is truthy at lines 83-89;
remove the dead error display JSX (lines 109-113) or consolidate both error
renderings into a single error UI by keeping the early return and deleting the
later block so there are no duplicate/unreachable error renders.

Comment on lines +134 to +139
{ach.event_id && (
<div className="flex items-center gap-2">
<Award className="w-4 h-4 text-gray-500 flex-shrink-0" />
<span>Event: {ach.event_id.title}</span>
</div>
)}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion | 🟠 Major

Add optional chaining for event title.

If ach.event_id exists but title is missing or undefined, this will display "Event: undefined". Use optional chaining on the title property for safer rendering.

🔎 Proposed fix
                {ach.event_id && (
                  <div className="flex items-center gap-2">
                    <Award className="w-4 h-4 text-gray-500 flex-shrink-0" />
-                    <span>Event: {ach.event_id.title}</span>
+                    <span>Event: {ach.event_id.title || "Untitled"}</span>
                  </div>
                )}
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
{ach.event_id && (
<div className="flex items-center gap-2">
<Award className="w-4 h-4 text-gray-500 flex-shrink-0" />
<span>Event: {ach.event_id.title}</span>
</div>
)}
{ach.event_id && (
<div className="flex items-center gap-2">
<Award className="w-4 h-4 text-gray-500 flex-shrink-0" />
<span>Event: {ach.event_id.title || "Untitled"}</span>
</div>
)}
🤖 Prompt for AI Agents
In frontend/src/Components/GenSec/AchievementsEndorsementTab.jsx around lines
134 to 139, the JSX renders ach.event_id.title directly which may produce
"Event: undefined" if title is missing; update the rendering to use optional
chaining (e.g., ach.event_id?.title) and provide a safe fallback (empty string
or "Unknown") so the UI never shows "undefined".

@harshitap1305 harshitap1305 merged commit 641729c into OpenLake:main Dec 20, 2025
1 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

refactor(auth): Remove Local (Email/Password) Sign-Up Functionality

1 participant