Update artifacts/fb-publisher/src/App.tsx
Browse files
artifacts/fb-publisher/src/App.tsx
CHANGED
|
@@ -6,13 +6,17 @@ import { QueryClientProvider } from "@tanstack/react-query";
|
|
| 6 |
import { queryClient } from "./lib/queryClient";
|
| 7 |
import Publisher from "@/pages/Publisher";
|
| 8 |
|
|
|
|
| 9 |
const firebaseConfig = {
|
| 10 |
-
apiKey:
|
| 11 |
-
authDomain:
|
| 12 |
-
projectId:
|
| 13 |
-
|
|
|
|
|
|
|
| 14 |
};
|
| 15 |
|
|
|
|
| 16 |
const app = initializeApp(firebaseConfig);
|
| 17 |
const auth = getAuth(app);
|
| 18 |
const googleProvider = new GoogleAuthProvider();
|
|
@@ -23,6 +27,7 @@ function HomePage() {
|
|
| 23 |
|
| 24 |
useEffect(() => {
|
| 25 |
const unsubscribe = onAuthStateChanged(auth, (firebaseUser) => {
|
|
|
|
| 26 |
setUser(firebaseUser);
|
| 27 |
setLoading(false);
|
| 28 |
});
|
|
@@ -44,7 +49,7 @@ function HomePage() {
|
|
| 44 |
if (user) {
|
| 45 |
return (
|
| 46 |
<div className="min-h-screen bg-[#0f0f1e] flex flex-col items-center justify-center gap-4">
|
| 47 |
-
<h1 className="text-white text-2xl font-bold">
|
| 48 |
<p className="text-gray-400">مرحباً، {user.displayName || user.email}</p>
|
| 49 |
<button onClick={handleLogout} className="bg-red-600 text-white px-6 py-3 rounded-lg">تسجيل خروج</button>
|
| 50 |
<Redirect to="/app" />
|
|
|
|
| 6 |
import { queryClient } from "./lib/queryClient";
|
| 7 |
import Publisher from "@/pages/Publisher";
|
| 8 |
|
| 9 |
+
// ✅ التكوين الصحيح - بدون analytics
|
| 10 |
const firebaseConfig = {
|
| 11 |
+
apiKey: "AIzaSyBMZV3pjYNxpMWbkyJbp1anaE2p1YCRWcg",
|
| 12 |
+
authDomain: "fb-publisher-pro.firebaseapp.com",
|
| 13 |
+
projectId: "fb-publisher-pro",
|
| 14 |
+
storageBucket: "fb-publisher-pro.firebasestorage.app",
|
| 15 |
+
messagingSenderId: "1003179857534",
|
| 16 |
+
appId: "1:1003179857534:web:8ede54d5d8c22685ad2a2f",
|
| 17 |
};
|
| 18 |
|
| 19 |
+
// Initialize Firebase
|
| 20 |
const app = initializeApp(firebaseConfig);
|
| 21 |
const auth = getAuth(app);
|
| 22 |
const googleProvider = new GoogleAuthProvider();
|
|
|
|
| 27 |
|
| 28 |
useEffect(() => {
|
| 29 |
const unsubscribe = onAuthStateChanged(auth, (firebaseUser) => {
|
| 30 |
+
console.log("Firebase user:", firebaseUser?.email);
|
| 31 |
setUser(firebaseUser);
|
| 32 |
setLoading(false);
|
| 33 |
});
|
|
|
|
| 49 |
if (user) {
|
| 50 |
return (
|
| 51 |
<div className="min-h-screen bg-[#0f0f1e] flex flex-col items-center justify-center gap-4">
|
| 52 |
+
<h1 className="text-white text-2xl font-bold">✅ Firebase شغال!</h1>
|
| 53 |
<p className="text-gray-400">مرحباً، {user.displayName || user.email}</p>
|
| 54 |
<button onClick={handleLogout} className="bg-red-600 text-white px-6 py-3 rounded-lg">تسجيل خروج</button>
|
| 55 |
<Redirect to="/app" />
|