@@ -34,7 +48,7 @@ function IndexPage({ user }: Props) {
-
@@ -54,4 +68,4 @@ function IndexPage({ user }: Props) {
>);
}
-export default IndexPage
+export default IndexPage;
\ No newline at end of file
diff --git a/src/router.tsx b/src/router.tsx
index a8c8d51..92a7964 100644
--- a/src/router.tsx
+++ b/src/router.tsx
@@ -49,7 +49,7 @@ const tileset_many: Array<{ text: string; rows: number; cols: number }> = [
{ text: "Tile 13", cols: 2, rows: 2 },
{ text: "Tile 14", cols: 2, rows: 2 },
{ text: "Tile 15", cols: 1, rows: 1 },
- { text: "Tile 16", cols: 1, rows: 1 },
+ {text: "Tile 16", cols: 1, rows:1 },
{ text: "Tile 17", cols: 1, rows: 1 },
{ text: "Tile 18", cols: 1, rows: 1 },
{ text: "Tile 19", cols: 2, rows: 1 },
@@ -97,7 +97,7 @@ const tileset_weird: Array<{ text: string; rows: number; cols: number }> = [
export const router = createBrowserRouter([
{
path: "/",
- element:
,
+ element:
,
errorElement: <_404Page/>
},
{
@@ -114,7 +114,7 @@ export const router = createBrowserRouter([
{
path: "/user-test",
element:
,
- errorElement: <_404Page/>
+ errorElement:<_404Page/>
},
{
path: "/graphs",
diff --git a/src/utils/authentication.ts b/src/utils/authentication.ts
index 1834929..d175301 100644
--- a/src/utils/authentication.ts
+++ b/src/utils/authentication.ts
@@ -6,13 +6,16 @@ import { signInWithPopup } from "firebase/auth";
const googleProvider = new GoogleAuthProvider();
// Function to sign in with Google
-export const signInWithGoogle = async () => {
+export const signInWithGoogle = async (): Promise => {
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)
+ // Return the entire user object
+ return user;
} catch (error) {
console.error(error);
+ // Return null if there was an error
+ return null;
}
-};
+};
\ No newline at end of file