fix: resolve frontend env variable mismatch and improve password error handling#510
Conversation
- Replace raw user_id with SHA256 hash (8-char prefix) in all log statements - Maintains audit trail capability while protecting user identifiers (PII) - Complies with GDPR/CCPA privacy requirements - Hash is deterministic for correlation without exposing PII Resolves CodeRabbit PII logging concern
…backfill Fix tenant ticket orphaning by persisting company_id on save
…ashboard feat: Real-time Support Dashboard Updates Using Supabase Realtime Channels
…y bugs on Ticket Detail page
…bles across UI and config
… with premium header
…link them in landing footer
…and style premium elements
…r handling ### Frontend env variable (Issue ritesh-1918#276) - Update config.js to support both VITE_BACKEND_URL and VITE_API_URL - Maintains backward compatibility with existing .env files - Fixes local development connection issues ### Password handling (Issue ritesh-1918#253) - Add friendly error message for Supabase password validation - Replace raw Supabase error with clear requirements: 'Password must contain at least: 8 characters, one uppercase letter (A-Z), one lowercase letter (a-z), and one number (0-9).' Closes ritesh-1918#276, Closes ritesh-1918#253
|
Someone is attempting to deploy a commit to the ritesh Team on Vercel. A member of the Team first needs to authorize it. |
📝 WalkthroughWalkthroughThis PR addresses two distinct bugs: environment variable mismatch in backend URL configuration that prevents local development, and inconsistent Supabase password validation error messaging in signup forms. Changes standardize environment variable handling and normalize password constraint errors. ChangesBug fixes for environment configuration and signup error handling
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~5 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
ESLint skipped: no ESLint configuration detected in root package.json. To enable, add 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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (1)
Frontend/src/pages/Signup.jsx (1)
172-172: ⚡ Quick winConsider case-insensitive error message matching.
The error detection uses case-sensitive
includes()which could miss variations in casing. UsingtoLowerCase()would make the detection more robust.♻️ Proposed fix for case-insensitive matching
- if (errMsg.includes("Password should contain") || errMsg.includes("at least one character")) { + if (errMsg.toLowerCase().includes("password should contain") || errMsg.toLowerCase().includes("at least one character")) { errMsg = "Password must contain at least: 8 characters, one uppercase letter (A-Z), one lowercase letter (a-z), and one number (0-9)."; }🤖 Prompt for 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. In `@Frontend/src/pages/Signup.jsx` at line 172, The error check in Signup.jsx uses case-sensitive includes on errMsg which can miss differently-cased messages; update the condition that references errMsg to perform case-insensitive matching by normalizing errMsg to lowercase (e.g., use (errMsg || "").toLowerCase()) and compare against lowercase substrings for both checks ("password should contain" and "at least one character"), replacing the existing includes calls in the if condition.
🤖 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.
Nitpick comments:
In `@Frontend/src/pages/Signup.jsx`:
- Line 172: The error check in Signup.jsx uses case-sensitive includes on errMsg
which can miss differently-cased messages; update the condition that references
errMsg to perform case-insensitive matching by normalizing errMsg to lowercase
(e.g., use (errMsg || "").toLowerCase()) and compare against lowercase
substrings for both checks ("password should contain" and "at least one
character"), replacing the existing includes calls in the if condition.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 9f24ee73-0180-49f8-9574-9ebf34f65cc8
📒 Files selected for processing (2)
Frontend/src/config.jsFrontend/src/pages/Signup.jsx
|
| GitGuardian id | GitGuardian status | Secret | Commit | Filename | |
|---|---|---|---|---|---|
| 29368972 | Triggered | Supabase Service Role JWT | b460068 | scratch/test_companies.js | View secret |
🛠 Guidelines to remediate hardcoded secrets
- Understand the implications of revoking this secret by investigating where it is used in your code.
- Replace and store your secret safely. Learn here the best practices.
- Revoke and rotate this secret.
- If possible, rewrite git history. Rewriting git history is not a trivial act. You might completely break other contributing developers' workflow and you risk accidentally deleting legitimate data.
To avoid such incidents in the future consider
- following these best practices for managing and storing secrets including API keys and other credentials
- install secret detection on pre-commit to catch secret before it leaves your machine and ease remediation.
🦉 GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request.
|
Hi @unsiqasik! Thanks for the contribution. I have successfully converted your PR's target branch to PR approved and merged! Welcome to the family! 🚀💻 🌟 Developer Action NetworkBefore starting or submitting updates, please complete these quick onboarding steps:
Note: All PR branches must target the |
Summary
Fixes two frontend issues:
Frontend env variable mismatch (Issue #276)
Password handling error (Issue #253)
Password should contain at least one character of each: abcdefghijklmnopqrstuvwxyz, ABCDEFGHIJKLMNOPQRSTUVWXYZ, 0123456789.Password must contain at least: 8 characters, one uppercase letter (A-Z), one lowercase letter (a-z), and one number (0-9).Testing
Closes #276, Closes #253
Summary by CodeRabbit
Bug Fixes