Skip to content

Commit

Permalink
Removed useless console logs
Browse files Browse the repository at this point in the history
  • Loading branch information
Robert-M-Lucas committed Apr 28, 2024
1 parent 603adc3 commit db3a06c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 10 deletions.
9 changes: 3 additions & 6 deletions src/utils/authentication.ts
Original file line number Diff line number Diff line change
@@ -1,18 +1,15 @@
import { GoogleAuthProvider } from "firebase/auth";
import {GoogleAuthProvider, signInWithPopup, User} 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 (): Promise<any> => {
export const signInWithGoogle = async (): Promise<User | null> => {
try {
const result = await signInWithPopup(auth, googleProvider);
const user = result.user;
console.log(user);
// Return the entire user object
return user;
return result.user;
} catch (error) {
console.error(error);
// Return null if there was an error
Expand Down
5 changes: 1 addition & 4 deletions src/utils/user_prefs.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,6 @@ describe("Firestore UserPrefs Tests", () => {
// @ts-expect-error
const read_prefs = await getUserPrefs(user);

console.log(new_prefs);
console.log(read_prefs);

expect(_.isEqual(read_prefs, prefs), "UserPref changes to be read").toBeTruthy();
expect(_.isEqual(read_prefs, new_prefs), "UserPref changes to be read").toBeTruthy();
});
});

0 comments on commit db3a06c

Please sign in to comment.