fix(auth): standardize login field to email and fix VITE_API_BASE_URL…#50
Open
latakshsariyapatidar wants to merge 2 commits into
Open
Conversation
Author
|
Hi @rdodiya, I've pushed the additional changes to this PR:
Please review when you get a chance. Happy to make further adjustments if needed! 🙏 |
Owner
|
Hi @latakshsariyapatidar , |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed?
Fixes two issues in the frontend config and login flow, and aligns the backend to use
emailas the auth identifier as requested by @rdodiya.Frontend
api.js: Replacedimport.meta.env.API_BASE_URLwithimport.meta.env.VITE_API_BASE_URLso Vite correctly exposes the env variable instead of silently falling back to hardcoded localhostLogin.jsx: Standardized Formik initial values, input field bindings, and validation error rendering fromusername→email. Added email format validation.Backend
LoginRequest.java: Renamedusernamefield toemail, added@EmailvalidationAuthServiceImpl.java: Updated authentication logic to look up users byemailAuthResponse.java: Updated response payload to returnemailfieldType
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
emailfield replacesusernameacross the full auth flow as per maintainer's guidance.