getting agoratoken works

This commit is contained in:
Arjun Patel
2022-01-22 19:30:44 -08:00
parent bed5834681
commit 1baa07faa4
9 changed files with 163 additions and 10 deletions
+3
View File
@@ -11,6 +11,7 @@ import React, { useContext, useEffect, useState } from "react";
import toast from "react-hot-toast";
import Loading from "../components/Loading";
import firebase from "../services/firebaseService";
import cookie from "js-cookie";
const AuthContext = React.createContext(null);
const googleProvider = new GoogleAuthProvider();
@@ -34,8 +35,10 @@ export function AuthProvider({ children }) {
// set the token in the cookies for ssr verification
const token = await user.getIdToken();
// nookies.set(undefined, "token", token, { path: "/" });
cookie.set("auth", token);
} else {
// nookies.set(undefined, "token", "", { path: "/" });
cookie.remove("auth");
setCurrUser(null);
}