Skip to content

fix: merge triple-duplicated createContext/AuthProvider into single export#381

Open
Tinna23 wants to merge 1 commit into
Lead-Studios:mainfrom
Tinna23:fix/auth-context-duplicate
Open

fix: merge triple-duplicated createContext/AuthProvider into single export#381
Tinna23 wants to merge 1 commit into
Lead-Studios:mainfrom
Tinna23:fix/auth-context-duplicate

Conversation

@Tinna23

@Tinna23 Tinna23 commented Jun 24, 2026

Copy link
Copy Markdown

Summary

Resolves a three-way merge artifact in src/context/authContext.tsx that left three separate createContext calls and three AuthProvider bodies in the same file.

Changes

  • Removed two duplicate createContext declarations and their incomplete AuthProvider bodies
  • Kept only the third AuthProvider — the one containing the real /api/auth/me bootstrap logic
  • Tightened the AuthUser type to { id, email, name?, role? } matching the issue spec
  • Added the required useAuth() hook (throws if called outside AuthProvider)
  • Fixed the accidental double res.json() call (another merge artifact)
  • No callers used useContext(AuthContext) directly outside the new hook

Testing

  • npm run build — zero TypeScript errors introduced by this file
  • No runtime logic changed; bootstrap behaviour is identical to the original third block

Closes #359

…xport

- Remove two duplicate createContext declarations and AuthProvider bodies
- Keep only the third AuthProvider with the /api/auth/me bootstrap logic
- Tighten AuthUser type: id, email, name?, role?
- Add useAuth() hook that throws if used outside AuthProvider
- Fix double res.json() call (merge artifact)

Closes Lead-Studios#359
@drips-wave

drips-wave Bot commented Jun 24, 2026

Copy link
Copy Markdown

@Tinna23 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

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.

FE-xxx: fix: authContext.tsx has triple-duplicated createContext and AuthProvider — merge into single clean export

1 participant