feat(login): add back-to-home navigation link#130
Conversation
There was a problem hiding this comment.
Looks Good To Meow 🐱
Hey @! Nice work on this one. This PR adds a 'Back to Home' navigation link to the login page, improving UX by providing a clear exit path for unauthenticated users. No critical or high-severity issues were found; only minor UX, consistency, and documentation improvements are suggested. Overall, the implementation is sound and ready to merge.
I left a few minor suggestions below — nothing blocking, just things to consider.
Note: This is an AI-generated approval. A maintainer will follow up with the final human review shortly.
Nice-to-haves
- Replace Unicode arrow with a consistent icon component for UI consistency.
- Add inline comment for the new navigation button and update README to mention the feature.
- Consider warning users about unsaved form data when navigating away from the login page.
Findings breakdown (10 total)
1 medium / 4 low / 5 info
Confidence: 95%
🔗 View Full Review Report — detailed findings, severity breakdown, and agent analysis
Reviewed by Looks Good To Meow — AI-powered code review
💬 You can interact with me directly in this PR:
@tarin-lgtm fix [any constraints]@tarin-lgtm explain [your question]@tarin-lgtm improve [focus area]@tarin-lgtm test [what to focus on]
| {/* ✅ Back to Home */} | ||
| <button | ||
| type="button" | ||
| onClick={() => navigate("/")} |
There was a problem hiding this comment.
🔍 Medium — The navigation to home (navigate("/")) is triggered directly in the onClick handler of a button without any confirmation or state check. If there is unsaved form data, the user may lose it without warning.
Consider prompting the user for confirmation if there is unsaved input before navigating away from the form, or ensure form state is reset/handled appropriately on navigation.
best-practices
| {/* ✅ Back to Home */} | ||
| <button | ||
| type="button" | ||
| onClick={() => navigate("/")} |
There was a problem hiding this comment.
💡 Suggestion — The navigation button uses navigate("/") to redirect users to the home page. If the navigate function or route handling is ever changed to accept user input or query parameters, this could introduce an open redirect vulnerability. Currently, the risk is low because the destination is hardcoded, but this pattern should be monitored if refactored.
Ensure that all navigation destinations are hardcoded or validated, and never accept user-controlled input for navigation paths without strict allowlisting.
security
| {/* ✅ Back to Home */} | ||
| <button | ||
| type="button" | ||
| onClick={() => navigate("/")} |
There was a problem hiding this comment.
💡 Suggestion — The new 'Back to Home' button uses navigate("/") without checking for unsaved form state or in-progress authentication. This could allow users to accidentally lose form input or interrupt an authentication process.
Consider prompting the user for confirmation if there is unsaved input or an authentication process is ongoing (e.g., loading/otpLoading).
bugs
| <div className="max-w-md w-full"> | ||
| <div className="smoke-card p-8 relative smoke-effect"> | ||
| {/* ✅ Back to Home */} | ||
| <button |
There was a problem hiding this comment.
💡 Suggestion — The new 'Back to Home' button introduces a navigation action, but there is no inline comment explaining its purpose or why it is conditionally rendered here. While the button is simple, a brief comment would help future maintainers understand its intent, especially since the rest of the form is complex and stateful.
Add an inline comment above the button to clarify its purpose, e.g., '// Navigates user back to the home page from the login/signup form'.
documentation
| {/* ✅ Back to Home */} | ||
| <button | ||
| type="button" | ||
| onClick={() => navigate("/")} |
There was a problem hiding this comment.
💡 Suggestion — The onClick handler for the 'Back to Home' button is defined inline as an arrow function in JSX. This creates a new function instance on every render, which can cause unnecessary re-renders of child components if this button is ever memoized or passed as a prop.
Define the navigation handler as a useCallback hook or a named function outside the render to avoid unnecessary function recreation on each render.
performance
🚀 Feature: Add "Back to Home" Navigation to Login Page
Closes: #113
📝 Description
Currently, the "Access Vault" (Login) page lacks a clear exit path for unauthenticated users, which can lead to higher bounce rates. This PR introduces a "Back to Home" navigation link to improve the User Experience (UX) and provide a seamless way for users to return to the landing page.
🛠 Changes Made
✅ Checklist