Database auth is fully fixed and functional except for outbound firebase.

This commit is contained in:
Patrick Fic
2019-12-06 12:05:33 -08:00
parent ab1e4d5424
commit 78c43fa1e5
58 changed files with 8435 additions and 140 deletions

View File

@@ -10,8 +10,8 @@ export default function Auth() {
useEffect(() => {
return firebase.auth().onAuthStateChanged(async user => {
console.log("User in App Container.js: ", user);
if (user) {
console.log('Current User:', user)
const token = await user.getIdToken();
const idTokenResult = await user.getIdTokenResult();
const hasuraClaim =
@@ -24,17 +24,12 @@ export default function Auth() {
const metadataRef = firebase
.database()
.ref("metadata/" + user.uid + "/refreshTime");
metadataRef.on("value", async () => {
// Force refresh to pick up the latest custom claims changes.
const token = await user.getIdToken(true);
setAuthState({ status: "in", user, token });
});
}
console.log("#####Logged In. make a gql call to upsert", user);
} else {
setAuthState({ status: "out" });
}