Database auth is fully fixed and functional except for outbound firebase.
This commit is contained in:
@@ -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" });
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user