Skip to content

fix: remove unnecessary useEffect + useState for AUTH_TYPE constant#974

Open
LikiosSedo wants to merge 1 commit intoMODSetter:devfrom
LikiosSedo:fix/remove-authtype-useeffect
Open

fix: remove unnecessary useEffect + useState for AUTH_TYPE constant#974
LikiosSedo wants to merge 1 commit intoMODSetter:devfrom
LikiosSedo:fix/remove-authtype-useeffect

Conversation

@LikiosSedo
Copy link
Contributor

@LikiosSedo LikiosSedo commented Mar 25, 2026

Summary

  • Replace useState + useEffect pattern with a direct constant for AUTH_TYPE in LocalLoginForm, since it's a build-time constant that never changes
  • Remove unused useEffect import

Test plan

  • Verify login form still shows "Sign up" link when AUTH_TYPE is LOCAL
  • Verify register redirect still works when AUTH_TYPE is not LOCAL

High-level PR Summary

This PR simplifies the LocalLoginForm component by removing an unnecessary useState and useEffect pattern used to manage the AUTH_TYPE constant. Since AUTH_TYPE is a build-time constant that never changes at runtime, it can be used directly without state management. The unused useEffect import is also removed as a result of this cleanup.

⏱️ Estimated Review Time: 5-15 minutes

💡 Review Order Suggestion
Order File Path
1 surfsense_web/app/(home)/login/LocalLoginForm.tsx

Need help? Join our Discord

Analyze latest changes

AUTH_TYPE is a static module-level import that never changes.
No need for useState + useEffect; use the constant directly.

Closes MODSetter#941
@vercel
Copy link

vercel bot commented Mar 25, 2026

@LikiosSedo is attempting to deploy a commit to the Rohan Verma's projects Team on Vercel.

A member of the Team first needs to authorize it.

Copy link

@recurseml recurseml bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review by RecurseML

🔍 Review performed on a474c46..97e7e73

✨ No bugs found, your code is sparkling clean

✅ Files analyzed, no issues (1)

surfsense_web/app/(home)/login/LocalLoginForm.tsx

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