Rename JSX to JS.
This commit is contained in:
@@ -1,27 +1,25 @@
|
||||
import { initializeApp } from "firebase/app";
|
||||
import { getAuth, onAuthStateChanged } from "firebase/auth";
|
||||
import { getAuth } from "firebase/auth";
|
||||
import env from "../env";
|
||||
import { store } from "../redux/store";
|
||||
import { signInSuccess, unauthorizedUser } from "../redux/user/user.actions";
|
||||
|
||||
initializeApp(env.firebase);
|
||||
|
||||
export const auth = getAuth();
|
||||
|
||||
export const unsubscribe = onAuthStateChanged(auth, (user) => {
|
||||
console.log("Auth State Check", user);
|
||||
store.dispatch(
|
||||
user
|
||||
? signInSuccess({
|
||||
uid: user.uid,
|
||||
email: user.email,
|
||||
displayName: user.displayName,
|
||||
photoURL: user.photoURL,
|
||||
authorized: true,
|
||||
})
|
||||
: unauthorizedUser()
|
||||
);
|
||||
});
|
||||
// export const unsubscribe = onAuthStateChanged(auth, (user) => {
|
||||
// console.log("Auth State Check", user);
|
||||
// store.dispatch(
|
||||
// user
|
||||
// ? signInSuccess({
|
||||
// uid: user.uid,
|
||||
// email: user.email,
|
||||
// displayName: user.displayName,
|
||||
// photoURL: user.photoURL,
|
||||
// authorized: true,
|
||||
// })
|
||||
// : unauthorizedUser()
|
||||
// );
|
||||
// });
|
||||
|
||||
export const getCurrentUser = () => {
|
||||
return new Promise((resolve, reject) => {
|
||||
|
||||
Reference in New Issue
Block a user