Skip to content

Add Remember Me functionality to login form - #385

Open
theabhinav wants to merge 2 commits into
vishnukothakapu:mainfrom
theabhinav:fix/nextjs-16-build-errors
Open

Add Remember Me functionality to login form#385
theabhinav wants to merge 2 commits into
vishnukothakapu:mainfrom
theabhinav:fix/nextjs-16-build-errors

Conversation

@theabhinav

@theabhinav theabhinav commented Jul 10, 2026

Copy link
Copy Markdown

Adds a "Remember Me" option to the login form for persistent user sessions.

Program Participation

I am contributing under EcSOc 2026.
image

Summary by CodeRabbit

  • New Features

    • Added “Remember me” support for credential sign-ins, allowing sessions to remain active for up to 30 days when selected.
    • Sessions without “Remember me” now expire after 24 hours.
    • OAuth sign-ins automatically receive an extended 30-day session.
    • Signing out now clears the “Remember me” preference.
  • Chores

    • Updated code-quality configuration without changing application behavior.

@vercel

vercel Bot commented Jul 10, 2026

Copy link
Copy Markdown

@theabhinav is attempting to deploy a commit to the vishnukothakapu's projects Team on Vercel.

A member of the Team first needs to authorize it.

@coderabbitai

coderabbitai Bot commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Warning

Review limit reached

@theabhinav, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 47 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 177dbaf2-da92-4708-95bc-e8ab52a482f9

📥 Commits

Reviewing files that changed from the base of the PR and between b066479 and 01c4eb1.

📒 Files selected for processing (2)
  • app/api/auth/[...nextauth]/route.ts
  • lib/auth.ts
📝 Walkthrough

Walkthrough

The authentication route now manages a remember-me cookie and adjusts NextAuth session lifetime for credentials, OAuth, signout, and subsequent requests. ScrollReveal adds a targeted ESLint suppression for its reduced-motion state update.

Changes

Remember-me authentication sessions

Layer / File(s) Summary
Remember-me request handling
app/api/auth/[...nextauth]/route.ts
The route parses sign-in payloads, sets or clears the remember-me cookie, recognizes OAuth callbacks, and passes a cookie-derived session.maxAge to NextAuth.

ScrollReveal lint configuration

Layer / File(s) Summary
Reduced-motion lint suppression
app/components/ScrollReveal.tsx
Adds an inline suppression for the existing setVisible(true) call in the reduced-motion effect branch.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Possibly related issues

  • vishnukothakapu/linkid#251 — The authentication route implements the issue’s remember-me persistent-session behavior.

Suggested labels: level:intermediate, type:feature

Suggested reviewers: vedhapprakashni

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly matches the main change: adding Remember Me session persistence for login/auth flows.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

@coderabbitai coderabbitai Bot left a comment

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.

Actionable comments posted: 3

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@app/api/auth/`[...nextauth]/route.ts:
- Around line 23-33: Move the remember-me cookie write out of the
pre-authentication form-data handling in the auth wrapper and persist it only
after authorize() or signIn succeeds; ensure failed credentials cannot create or
retain a 30-day remember-me value, and reconcile or clear the cookie on
authentication failure. Use the wrapper’s authorize/sign-in flow and the
existing remember-me cookie handling branch as the integration points.
- Around line 16-20: Align rememberMe parsing in the form-data branch with the
JSON branch: update the assignment in the authentication route to accept the
same truthy representations, including boolean true and the string "true" (and
the expected checkbox value such as "on"), instead of only comparing against
"true".
- Around line 10-51: The credentials sign-in logic in the route handler does not
match the actual /callback/credentials endpoint, causing password logins to
always use the OAuth 30-day default. Update the POST credentials branch to match
/callback/credentials and ensure it executes before the generic
pathname.includes("/callback/") OAuth branch, preserving the existing rememberMe
parsing and cookie behavior.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: cd51dd72-0a37-4771-bb96-c58d558ee6e6

📥 Commits

Reviewing files that changed from the base of the PR and between d02bc2f and b066479.

📒 Files selected for processing (2)
  • app/api/auth/[...nextauth]/route.ts
  • app/components/ScrollReveal.tsx

Comment thread app/api/auth/[...nextauth]/route.ts
Comment thread app/api/auth/[...nextauth]/route.ts Outdated
Comment thread app/api/auth/[...nextauth]/route.ts Outdated
@vercel

vercel Bot commented Jul 13, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
linkid Error Error Jul 13, 2026 9:05am

@vishnukothakapu

Copy link
Copy Markdown
Owner

Hi @theabhinav ! The build is currently failing due to a TypeScript type error in lib/auth.ts.

credentials.rememberMe is of type CredentialInput, so comparing it directly with "true" (or other string literals) is invalid. Please update the implementation to use the correct type-safe handling for rememberMe, ensure the project passes npm run build, and then push the updated changes.

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants