Skip to content

feat: add OAuth error handling page for HuggingFace login failures #384 (PR -3)#495

Merged
param20h merged 2 commits into
param20h:devfrom
NaitikVerma6776:feat/settings-page
Jun 7, 2026
Merged

feat: add OAuth error handling page for HuggingFace login failures #384 (PR -3)#495
param20h merged 2 commits into
param20h:devfrom
NaitikVerma6776:feat/settings-page

Conversation

@NaitikVerma6776
Copy link
Copy Markdown
Contributor

Feature (PR-3)

Adds a dedicated error page at /auth/error to handle HuggingFace OAuth login failures gracefully instead of showing a blank/broken screen.

Changes

  • Created frontend/src/app/auth/error/page.tsx
  • Handles 5 error types with clear messages:
    • csrf_mismatch — Security/CSRF attack detected
    • token_exchange_failed — Token exchange failed
    • userinfo_failed — Profile fetch failed
    • email_required — Email not provided by HF
    • oauth_not_configured — Server misconfiguration
  • "Try Again" button → redirects to /login
  • "Go Home" button → redirects to /

🔗 Related Issue

Part of #384 — PR 3 of 4
Extends work from #136 resolved via PR #206

##Screenshots

Screenshot 2026-06-06 133412


Screenshot 2026-06-06 133740


Screenshot 2026-06-06 133808


Screenshot 2026-06-06 134052

🗂️ Type of Change

  • ✨ New feature
  • 🎨 UI / styling change

🧪 How was this tested?

  • Ran the frontend locally (npm run dev inside frontend/)
  • Tested all error codes via URL params ✅
  • http://localhost:3000/auth/error
  • http://localhost:3000/auth/error?error=csrf_mismatch
  • http://localhost:3000/auth/error?error=email_required
  • http://localhost:3000/auth/error?error=oauth_not_configured
  • "Try Again" navigates to /login ✅
  • "Go Home" navigates to / ✅

✅ Self-Review Checklist

  • My branch is based on dev, not main
  • I have not added any secrets / API keys
  • I have not modified main branch
  • My code follows the existing style
  • No unnecessary formatting changes

📋 PR Series Status (Issue #384)

PR Description Status
PR 1 Settings page with HF token management ✅ Submitted
PR 2 HF token status in Dashboard/Header ✅ Already implemented in PR #206
PR 3 OAuth error handling page ✅ This PR
PR 4 HuggingFaceTokenModal improvements 🔄 Upcoming

@NaitikVerma6776 NaitikVerma6776 requested a review from param20h as a code owner June 6, 2026 08:40
@NaitikVerma6776
Copy link
Copy Markdown
Contributor Author

⚠️ CI Failure Analysis — Pre-existing Issue

The failing Playwright test exists on the dev branch independently of this PR.

Proof:
GitHub Actions run on dev branch (triggered by PR #432):
https://github.com/param20h/PDF-Assistant-RAG/actions/runs/27055704867/job/79859570701

Same test failing on dev:
logs in with email and password

My change: Added frontend/src/app/auth/error/page.tsx
Failing test: Login redirect to /dashboard

These have zero connection. The test fails because
the backend is unavailable in CI environment —
this is a pre-existing issue on the dev branch.

My PR Results:

  • 8/9 tests passing ✅
  • TypeScript build passing ✅
  • PR Size Check passing ✅
  • 1 pre-existing backend-dependent test failing ❌
    (same failure exists on dev branch)

Next Steps:
I would like to fix this pre-existing Playwright test failure in a separate PR by making the login test resilient to backend unavailability in CI.
Please let me know if I should raise a new issue for this.

Requesting review and merge.

@param20h
Copy link
Copy Markdown
Owner

param20h commented Jun 6, 2026

⚠️ CI Failure Analysis — Pre-existing Issue

The failing Playwright test exists on the dev branch independently of this PR.

Proof:

GitHub Actions run on dev branch (triggered by PR #432):

https://github.com/param20h/PDF-Assistant-RAG/actions/runs/27055704867/job/79859570701

Same test failing on dev:

logs in with email and password

My change: Added frontend/src/app/auth/error/page.tsx

Failing test: Login redirect to /dashboard

These have zero connection. The test fails because

the backend is unavailable in CI environment —

this is a pre-existing issue on the dev branch.

My PR Results:

  • 8/9 tests passing ✅

  • TypeScript build passing ✅

  • PR Size Check passing ✅

  • 1 pre-existing backend-dependent test failing ❌

    (same failure exists on dev branch)

Next Steps:

I would like to fix this pre-existing Playwright test failure in a separate PR by making the login test resilient to backend unavailability in CI.

Please let me know if I should raise a new issue for this.

Requesting review and merge.

Ok go with it

@NaitikVerma6776
Copy link
Copy Markdown
Contributor Author

@param20h , kindly could you merge this PR as this is also a part of next PR which is PR -4 and also so that I could work on next one .

@NaitikVerma6776
Copy link
Copy Markdown
Contributor Author

Hi @param20h,

I have raised PR #499 which fixes the pre-existing Playwright CI failure that is showing on this PR.
Kindly merge that PR first — once merged, all CI checks on this PR will pass cleanly.

@NaitikVerma6776
Copy link
Copy Markdown
Contributor Author

Hi @param20h
This PR also includes PR 4 of issue #384— HuggingFaceTokenModal improvements:

  1. Token format validation (must start with hf_)
  2. Token preview (masked: hf_xxxx****xxxx)
  3. Remove token button

All 4 PRs for issue #384 are now covered in this branch.
Please merge the previous PR#495 which is PR-3 of this issue.
Thank you for this opportunity to work on this amazing issue. Looking forward for more such work.

@param20h param20h merged commit 34c8acb into param20h:dev Jun 7, 2026
6 checks passed
@github-actions github-actions Bot added gssoc GirlScript Summer of Code 2026 issue/PR gssoc:approved Approved for GSSoC base points (+50 pts) mentor:param20h Mentor for this PR labels Jun 7, 2026
@param20h param20h added level:critical +80 pts quality:exceptional 1.5x multiplier type:feature +10 pts type:performance +15 pts and removed type:performance +15 pts labels Jun 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gssoc:approved Approved for GSSoC base points (+50 pts) gssoc GirlScript Summer of Code 2026 issue/PR level:critical +80 pts mentor:param20h Mentor for this PR quality:exceptional 1.5x multiplier type:feature +10 pts

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants