>);
}
diff --git a/src/utils/authentication.ts b/src/utils/authentication.ts
new file mode 100644
index 0000000..1834929
--- /dev/null
+++ b/src/utils/authentication.ts
@@ -0,0 +1,18 @@
+import { GoogleAuthProvider } from "firebase/auth";
+import {auth} from "./firebase.ts";
+import { signInWithPopup } from "firebase/auth";
+
+// Initialize a new Google Auth Provider
+const googleProvider = new GoogleAuthProvider();
+
+// Function to sign in with Google
+export const signInWithGoogle = async () => {
+ try {
+ const result = await signInWithPopup(auth, googleProvider);
+ const user = result.user;
+ console.log(user);
+ // Do something with the user object (e.g. save to state)
+ } catch (error) {
+ console.error(error);
+ }
+};
diff --git a/src/utils/firebase.ts b/src/utils/firebase.ts
index a747275..21d8e6f 100644
--- a/src/utils/firebase.ts
+++ b/src/utils/firebase.ts
@@ -1,12 +1,9 @@
// Import the functions you need from the SDKs you need
import { initializeApp } from "firebase/app";
import { getAnalytics } from "firebase/analytics";
-
-// Add SDKs for Firebase products that you want to use
-// https://firebase.google.com/docs/web/setup#available-libraries
+import { getAuth } from "firebase/auth";
// Your web app's Firebase configuration
-// For Firebase JS SDK v7.20.0 and later, measurementId is optional
const firebaseConfig = {
apiKey: "AIzaSyD70wqk2KYojBO_fAEiWEhDbiz4lo8vw2s",
authDomain: "budget-19.firebaseapp.com",
@@ -19,4 +16,5 @@ const firebaseConfig = {
// Initialize Firebase
export const app = initializeApp(firebaseConfig);
-export const analytics = getAnalytics(app);
\ No newline at end of file
+export const analytics = getAnalytics(app);
+export const auth = getAuth(app); // Initialize Firebase Authentication
\ No newline at end of file