Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use observer pattern for auth state #37

Merged
merged 2 commits into from
Jan 18, 2025

Conversation

ThomasCode92
Copy link
Owner

This PR refactors the authentication state management by replacing manual React Context handling with Firebase's onAuthStateChanged function.

Changes:

  • Implemented onAuthStateChanged to listen for real-time authentication updates from Firebase.
  • Simplified logic to synchronize auth state directly with Firebase.
  • Removed redundant state management code from React Context.

Benefits:

  • Ensures accurate, real-time auth state updates.
  • Reduces potential for inconsistencies or delays.
  • Aligns with Firebase's best practices for authentication handling.

This update improves reliability, simplifies the codebase, and enhances developer & user experience.

@ThomasCode92 ThomasCode92 linked an issue Jan 18, 2025 that may be closed by this pull request
Copy link

@ThomasCode92 ThomasCode92 merged commit 026ba50 into main Jan 18, 2025
6 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
Development

Successfully merging this pull request may close these issues.

Use Observer Pattern for Auth State
1 participant