Skip to content

fix: Missing Password Error#2

Merged
BretRen merged 2 commits intomainfrom
fix/missing-password-error
Apr 12, 2026
Merged

fix: Missing Password Error#2
BretRen merged 2 commits intomainfrom
fix/missing-password-error

Conversation

@BretRen
Copy link
Copy Markdown
Member

@BretRen BretRen commented Apr 12, 2026

Summary by CodeRabbit

  • Bug Fixes
    • Improved error message handling during login to display clearer feedback when authentication fails under specific conditions, enhancing user experience when troubleshooting login issues.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 12, 2026

Warning

Rate limit exceeded

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

Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 18 minutes and 49 seconds.

⌛ 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: 31f1a73a-f3bf-4def-8839-51aa721e8bd8

📥 Commits

Reviewing files that changed from the base of the PR and between a7048aa and 5af5494.

📒 Files selected for processing (1)
  • website/src/routes/login/+page.svelte
📝 Walkthrough

Walkthrough

The login error handling logic now checks for HTTP 400 responses with empty data objects and uses the backend message directly, while preserving existing error handling for all other cases.

Changes

Cohort / File(s) Summary
Login Error Handling
website/src/routes/login/+page.svelte
Added conditional check for HTTP 400 errors with empty err.data?.data to extract error message from err.data.message directly, with early exit to bypass default error derivation logic.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰 A login page now sees the light,
When errors come without their sprite,
The message shines through, clear and bright,
No empty paths to cloud our sight,
The backend speaks—we get it right! ✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'fix: Missing Password Error' clearly identifies the specific issue being fixed—a missing password error in the login flow—which directly relates to the changes made in the login error handling path.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/missing-password-error

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.

Copy link
Copy Markdown

@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: 1

🧹 Nitpick comments (1)
website/src/routes/login/+page.svelte (1)

25-28: Consider centralizing auth error parsing shared with register.

This special-case handling now differs from website/src/routes/register/+page.svelte (Lines 32-44). A shared helper would prevent behavior drift between auth pages.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@website/src/routes/login/`+page.svelte around lines 25 - 28, The login page
contains special-case error parsing (checking Object.keys(errorData).length ===
0 && err.status == 400 and setting errorText = err.data.message) that duplicates
logic in the register page; extract that logic into a shared helper (e.g.,
parseAuthError or parseAuthErrorResponse) that takes the error object (err) and
existing errorData and returns the normalized errorText (or null) and use that
helper from both +page.svelte files to replace the inline conditional; ensure
the helper is exported and both components import and call it where they
currently handle the auth error.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@website/src/routes/login/`+page.svelte:
- Around line 25-28: The catch block currently dereferences err.data.message
unguarded; update the branch that checks for a 400 to first verify err.data and
err.data.message (or use optional chaining) before assigning to errorText so it
cannot throw when data is missing—e.g., guard the access to err.data.message and
fallback to a safe message (or err.message) when absent; locate the code around
errorData, err, and errorText in +page.svelte to apply this change.

---

Nitpick comments:
In `@website/src/routes/login/`+page.svelte:
- Around line 25-28: The login page contains special-case error parsing
(checking Object.keys(errorData).length === 0 && err.status == 400 and setting
errorText = err.data.message) that duplicates logic in the register page;
extract that logic into a shared helper (e.g., parseAuthError or
parseAuthErrorResponse) that takes the error object (err) and existing errorData
and returns the normalized errorText (or null) and use that helper from both
+page.svelte files to replace the inline conditional; ensure the helper is
exported and both components import and call it where they currently handle the
auth error.
🪄 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

Run ID: 622ed5bd-5d4e-40a9-ab62-4029333cc3eb

📥 Commits

Reviewing files that changed from the base of the PR and between 4cf10cc and a7048aa.

📒 Files selected for processing (1)
  • website/src/routes/login/+page.svelte

Comment thread website/src/routes/login/+page.svelte
@BretRen BretRen merged commit 3f06076 into main Apr 12, 2026
1 check passed
@BretRen BretRen deleted the fix/missing-password-error branch April 12, 2026 22:50
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.

1 participant