Skip to content
This repository has been archived by the owner on Jun 21, 2022. It is now read-only.

Commit

Permalink
Prepare for production(beta)
Browse files Browse the repository at this point in the history
  • Loading branch information
shauryaaher committed Mar 19, 2022
1 parent d12cba0 commit 28fb8e8
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions src/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,21 +11,21 @@ import {
GoogleAuthProvider,
deleteUser,
onAuthStateChanged,
connectAuthEmulator,
} from "firebase/auth";

import {
getFirestore,
onSnapshot,
query,
collection,
connectFirestoreEmulator,
} from "firebase/firestore";

import { initializeAppCheck, ReCaptchaV3Provider } from "firebase/app-check";

import { getPerformance } from "firebase/performance";

import { getAnalytics } from "firebase/analytics";

// Your web app's Firebase configuration
const firebaseConfig = {
apiKey: "AIzaSyDFu-GH9JPpz_ih9bFxbAhQmDqu5phkABQ",
Expand All @@ -34,12 +34,14 @@ const firebaseConfig = {
storageBucket: "to-do-46.appspot.com",
messagingSenderId: "437760326755",
appId: "1:437760326755:web:6090be559a31fe15ad0c56",
measurementId: "G-Y7S0G6SW65"
};

// Initialize App
const app = initializeApp(firebaseConfig);

getPerformance(app);
getAnalytics(app);

initializeAppCheck(app, {
provider: new ReCaptchaV3Provider("6Ld89ZoeAAAAAPu0KsEUIIab9JnEG8G9brw3djcL"),
Expand All @@ -48,9 +50,6 @@ initializeAppCheck(app, {
const auth = getAuth();
const firestore = getFirestore();

connectAuthEmulator(auth, "http://localhost:9099/");
connectFirestoreEmulator(firestore, "localhost", 8080);

const authProvider = new GoogleAuthProvider();

export default class App extends Component {
Expand All @@ -59,7 +58,7 @@ export default class App extends Component {
try {
await signInWithPopup(auth, authProvider);
console.log("You are now signed in");
window.location.replace("https://localhost:3000/");
window.location.replace("https://to-do-46.web.app");
window.location.reload();
} catch (error) {
console.error(error);
Expand All @@ -70,7 +69,7 @@ export default class App extends Component {
try {
await signOut(auth);
console.log("Successfully signed out");
window.location.replace("https://localhost:3000/");
window.location.replace("https://to-do-46.web.app");
window.location.reload();
} catch (error) {
console.error(error);
Expand All @@ -82,7 +81,7 @@ export default class App extends Component {
try {
await deleteUser(user);
console.log("Successfully deleted user");
window.location.replace("https://localhost:3000/");
window.location.replace("https://to-do-46.web.app");
window.location.reload();
} catch (error) {
console.error(error);
Expand Down

0 comments on commit 28fb8e8

Please sign in to comment.