Skip to content

refactor(auth): modularize login hook and remove duplicate schema - #98

Merged
saifulalomdev merged 1 commit into
mainfrom
features
Jun 17, 2026
Merged

refactor(auth): modularize login hook and remove duplicate schema#98
saifulalomdev merged 1 commit into
mainfrom
features

Conversation

@saifulalomdev

Copy link
Copy Markdown
Owner

📝 Description

This PR finalizes the architectural co-location of the authentication module. It shifts the login state hook directly into the auth domain and eliminates legacy global files to prevent structural drift.

Key Changes:

  • Domain Co-location: Renamed and migrated src/hooks/use-log-in.ts into src/modules/auth/auth.hooks.ts to keep feature hooks local.
  • Dead Code Elimination: Deleted the deprecated global schema file src/schema/login.ts in favor of the unified src/modules/auth/auth.schema.ts.
  • Component State Realignment: Updated the LogInForm UI component to use the localized hook imports and swapped out the variable references from isPending to isLoading to match the core useAction hook interface.

Fixes # (issue number)

🧪 Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Refactor / Chore (codebase maintenance or optimization)

🛠️ How Has This Been Tested?

  • Verified local authentication form input handling against the updated auth.schema.ts rules.

  • Confirmed submission UI states (Loading spinners and active/disabled buttons) toggle smoothly using the aligned isLoading state.

  • Checked project compilation to ensure no broken or stale import path aliases remain.

  • Unit/Integration tests added/passed

  • Local manual edge verification successful

📸 Screenshots / Diffs (if applicable)

File tracking:

  • Deleted: src/schema/login.ts
  • Moved & Updated: src/hooks/use-log-in.tssrc/modules/auth/auth.hooks.ts
  • Updated: src/modules/auth/components/login.tsx

✅ Checklist

  • My code follows the brutalist/minimal style guidelines of this project
  • I have performed a self-review of my own code
  • My changes generate no new typescript compiler or linter errors

- Rename and relocate `use-log-in.ts` hook to `modules/auth/auth.hooks.ts`
- Remove deprecated global `src/schema/login.ts` file
- Fix state naming mismatch in `LogInForm` component (`isPending` -> `isLoading`)
- Update import mappings to use local module schemas and hooks
@saifulalomdev
saifulalomdev merged commit 0efd5fa into main Jun 17, 2026
1 check 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

Development

Successfully merging this pull request may close these issues.

1 participant