Jobslines schema. Added phone number formatting.
This commit is contained in:
@@ -49,14 +49,14 @@ class AppContainer extends Component {
|
||||
// split based on operation type
|
||||
({ query }) => {
|
||||
const definition = getMainDefinition(query);
|
||||
console.log(
|
||||
"##Intercepted GQL Transaction : " +
|
||||
definition.operation +
|
||||
"|" +
|
||||
definition.name.value +
|
||||
"##",
|
||||
query
|
||||
);
|
||||
// console.log(
|
||||
// "##Intercepted GQL Transaction : " +
|
||||
// definition.operation +
|
||||
// "|" +
|
||||
// definition.name.value +
|
||||
// "##",
|
||||
// query
|
||||
// );
|
||||
return (
|
||||
definition.kind === "OperationDefinition" &&
|
||||
definition.operation === "subscription"
|
||||
|
||||
@@ -23,23 +23,24 @@ export default () => {
|
||||
|
||||
useEffect(() => {
|
||||
//Run the auth code only on the first render.
|
||||
const unsubscribeFromAuth = auth.onIdTokenChanged(async user => {
|
||||
const unsubscribeFromAuth = auth.onAuthStateChanged(async user => {
|
||||
if (user) {
|
||||
let token;
|
||||
token = await user.getIdToken();
|
||||
const idTokenResult = await user.getIdTokenResult();
|
||||
const hasuraClaim =
|
||||
idTokenResult.claims["https://hasura.io/jwt/claims"];
|
||||
if (!hasuraClaim) {
|
||||
// Check if refresh is required.
|
||||
const metadataRef = firebase
|
||||
.database()
|
||||
.ref("metadata/" + user.uid + "/refreshTime");
|
||||
|
||||
// Check if refresh is required.
|
||||
const metadataRef = firebase
|
||||
.database()
|
||||
.ref("metadata/" + user.uid + "/refreshTime");
|
||||
metadataRef.on("value", async params => {
|
||||
console.log("params", params);
|
||||
// Force refresh to pick up the latest custom claims changes.
|
||||
token = await user.getIdToken(true);
|
||||
});
|
||||
metadataRef.on("value", async () => {
|
||||
// Force refresh to pick up the latest custom claims changes.
|
||||
token = await user.getIdToken(true);
|
||||
});
|
||||
}
|
||||
|
||||
apolloClient.writeData({
|
||||
data: {
|
||||
|
||||
Reference in New Issue
Block a user