Skip to content

fix(auth): standardize login field to email and fix VITE_API_BASE_URL…#50

Open
latakshsariyapatidar wants to merge 2 commits into
rdodiya:gssoc_developfrom
latakshsariyapatidar:fix/login-email-field-and-vite-env
Open

fix(auth): standardize login field to email and fix VITE_API_BASE_URL…#50
latakshsariyapatidar wants to merge 2 commits into
rdodiya:gssoc_developfrom
latakshsariyapatidar:fix/login-email-field-and-vite-env

Conversation

@latakshsariyapatidar
Copy link
Copy Markdown

What changed?

Fixes two issues in the frontend config and login flow, and aligns the backend to use email as the auth identifier as requested by @rdodiya.

Frontend

  • api.js: Replaced import.meta.env.API_BASE_URL with import.meta.env.VITE_API_BASE_URL so Vite correctly exposes the env variable instead of silently falling back to hardcoded localhost
  • Login.jsx: Standardized Formik initial values, input field bindings, and validation error rendering from usernameemail. Added email format validation.

Backend

  • LoginRequest.java: Renamed username field to email, added @Email validation
  • AuthServiceImpl.java: Updated authentication logic to look up users by email
  • AuthResponse.java: Updated response payload to return email field

Type

  • New feature
  • Bug fix
  • Documentation

Testing

Tested locally — login form shows correct email validation errors, API calls hit the correct base URL, and backend authentication works with email as identifier.

Related Issue

Closes #28

Additional Notes

Changes are backward-compatible. The email field replaces username across the full auth flow as per maintainer's guidance.

@latakshsariyapatidar
Copy link
Copy Markdown
Author

Hi @rdodiya,

I've pushed the additional changes to this PR:

  • Updated CustomUserDetailsService.java to fix the hardcoded default username/password issue
  • Tested the full login flow — login works correctly with the default credentials.

Please review when you get a chance. Happy to make further adjustments if needed! 🙏

@rdodiya
Copy link
Copy Markdown
Owner

rdodiya commented May 13, 2026

Hi @latakshsariyapatidar ,
Please resolve conflicts.

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.

Fix Vite API base URL env variable and login form field mismatch

2 participants