fixing updating of status so that we get it done on unload

This commit is contained in:
Arjun Patel
2022-01-16 00:44:48 -08:00
parent a87b1742d5
commit 9b5af00466
3 changed files with 6 additions and 4 deletions
+3 -1
View File
@@ -7,6 +7,7 @@ import {
User,
} from "firebase/auth";
import React, { useContext, useEffect, useState } from "react";
import toast from "react-hot-toast";
import firebase from "../services/firebaseService";
const AuthContext = React.createContext(null);
@@ -44,6 +45,7 @@ export function AuthProvider({ children }) {
.then((res) => {
// This gives you a Google Access Token. You can use it to access the Google API.
const credential = GoogleAuthProvider.credentialFromResult(res);
const token = credential.accessToken;
// The signed-in user info.
const user = res.user;
@@ -61,7 +63,7 @@ export function AuthProvider({ children }) {
// The AuthCredential type that was used.
const credential = GoogleAuthProvider.credentialFromError(error);
console.log(error);
throw error;
toast.error("something went wrong");
});
};