Skip to content

feat(forms): integrate react-hook-forms and fix login/register redirect issues - #26

Merged
fu050409 merged 16 commits into
mainfrom
yeswmerak
Apr 27, 2026
Merged

fu050409 merged 16 commits into
mainfrom
yeswmerak

Conversation

@YESWmeshade

Copy link
Copy Markdown
Contributor

🧩 Forms Refactor & Redirect Fixes

Closes #20
Closes #21
Closes #22


🎯 Overview

This PR introduces react-hook-form integration for login and registration pages, and fixes incorrect navigation behaviors during authentication flows.


✨ Improvements

  • ✅ Integrated react-hook-form for form state management and validation
  • ✅ Replaced manual useState form handling with RHF
  • ✅ Added proper client-side validation rules
  • ✅ Fixed incorrect redirect after login
  • ✅ Fixed register page redirecting even when API request fails
  • ✅ Prevent navigation when authentication request throws an error

🛠 Behavioral Fixes

🐛 Issue #21 – Login invalid navigation

  • Previously: Login redirected to incorrect route
  • Now: Redirect only occurs after successful login

🐛 Issue #22 – Register redirect on API failure

  • Previously: Page redirected even if register API failed
  • Now: Redirect only occurs when request resolves successfully

🔐 Authentication Flow

Login/Register now follows this pattern:

  1. Form validation (RHF)
  2. API request
  3. On success → navigate
  4. On failure → show error message (no redirect)

📦 Technical Changes

  • Adopted react-hook-form for cleaner form logic
  • Improved type safety with generated API types
  • Removed manual input state handling
  • Preserved existing UI components (shadcn)

@github-actions

github-actions Bot commented Feb 12, 2026 •

Copy link
Copy Markdown

Workspace change through: 450665b

15 changesets found

Planned changes to release
Package Bump Level Current Version Next Version
merak patch 0.1.0-alpha.0 0.1.0-alpha.1
merak-macros patch 0.1.0-alpha.0 0.1.0-alpha.1
@merak/merak patch 0.1.0-alpha.0 0.1.0
merak-core patch 0.1.0-alpha.0 0.1.0-alpha.1

@fu050409
fu050409 merged commit b1fd96b into main Apr 27, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants