MingInc / ming

This repository consists of a monolithic architecture project for Ming.
https://www.minginc.xyz
Creative Commons Zero v1.0 Universal
2 stars 1 forks source link

Need Context or Redux for Firebase Authentication Variables #10

Closed 13x54n closed 3 months ago

13x54n commented 3 months ago

Currently, auth is initialized on every component that needs firebase authentication. So, on each initialization the page is rendering the authentication provider on console. image

Code:

useEffect(() => {
    const app = initializeApp(firebaseConfig);
    const authInstance = getAuth(app); // console created from this line
    setAuth(authInstance);
  }, []);

Solution Create a global context for authentication.

13x54n commented 3 months ago

Fixed on latest commit.