Skip to content

fix: preserve session on transient auth checks#82

Open
saurabhhhcodes wants to merge 1 commit into
kunalverma2512:mainfrom
saurabhhhcodes:fix/preserve-session-transient-auth-39
Open

fix: preserve session on transient auth checks#82
saurabhhhcodes wants to merge 1 commit into
kunalverma2512:mainfrom
saurabhhhcodes:fix/preserve-session-transient-auth-39

Conversation

@saurabhhhcodes
Copy link
Copy Markdown

Fixes #39.

What changed

  • Auth bootstrapping now clears stored credentials only when profile refresh returns a real auth failure (401 or 403).
  • Temporary network/server failures preserve the stored token and cached user instead of logging the user out.
  • Verified profile data is cached after login/profile refresh so the UI can stay stable during transient outages.
  • The shared API interceptor now treats 401/403 as auth failures while leaving other failures to callers.

Validation

  • cd frontend && ./node_modules/.bin/eslint src/context/AuthContext.jsx src/services/api.js
  • git diff --check

Note: cd frontend && ./node_modules/.bin/vite build is blocked locally by the installed Rolldown native binding failing macOS code-signing/native optional dependency loading, before app code compiles.

Suggested labels for GSSoC: gssoc:approved, level:intermediate, quality:clean, type:bug.

@github-actions
Copy link
Copy Markdown

🚀 PR Received Successfully

Hello @saurabhhhcodes,

Thank you for taking the initiative to contribute to this project.

Please ensure that your PR follows all project guidelines properly before requesting review.

⚠️ Important Instructions

  • Maintain proper code quality and structure
  • Do not make unnecessary changes/files
  • Ensure responsiveness across devices
  • Follow existing project conventions strictly
  • Attach screenshots/videos for UI-related changes
  • Resolve merge conflicts before requesting review
  • Avoid AI-generated low quality PRs or copied implementations

📌 Mandatory for GSSoC'26 Participants

Joining the community group and announcement channel is compulsory for all contributors participating through GSSoC'26.

Failure to follow contribution guidelines may lead to PR rejection.

We appreciate your effort and wish you a great open-source journey ahead. ✨

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 19, 2026

Warning

Rate limit exceeded

@saurabhhhcodes has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 56 minutes and 30 seconds before requesting another review.

You’ve run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 00b5866f-9b25-41a3-a06a-8860692fbf47

📥 Commits

Reviewing files that changed from the base of the PR and between 47f72c6 and 78baa4c.

📒 Files selected for processing (2)
  • frontend/src/context/AuthContext.jsx
  • frontend/src/services/api.js
✨ 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 and usage tips.

@saurabhhhcodes
Copy link
Copy Markdown
Author

Quick follow-up: this PR is still clean and mergeable from my side. If there is no further feedback needed here, please review and merge when convenient; I can respond quickly if you want any changes.

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.

Prevent Unnecessary User Logout During Temporary Network/API Failures

1 participant