Skip to content

Commit 9262247

Browse files
committed
Still getting this 'law of hooks' error
1 parent f6fbe0e commit 9262247

File tree

10 files changed

+149
-121
lines changed

10 files changed

+149
-121
lines changed

.env

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
HASURA_DNSNAME=graphql-engine
55
HASURA_INTERNAL_PORT=8080
66
HASURA_EXTERNAL_PORT=8081
7-
HASURA_UNAUTHORIZED_ROLE=anonymous
87
HASURA_ENABLE_CONSOLE=true
98
# Securely generate below as 30+ character strings in Lastpass
109
HASURA_ADMIN_SECRET=PLEASECHANGEMEtoanextremelylongpassword

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ This is an example [react-admin](https://marmelab.com/react-admin/) application
66

77
## Available Scripts
88

9-
In the project directory, you can run: `docker-compose up --quiet-pull --force-recreate --build`
9+
In the project directory, you can run: `docker-compose up --quiet-pull --renew-anon-volumes --build`
1010

1111
It will take more time to run the first time, as Docker installs node_modules in a temporary container.
1212

docker-compose.yaml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,11 @@ services:
4242
HASURA_GRAPHQL_DATABASE_URL: postgres://${HASURA_DB_USER}:${HASURA_DB_PASS}@${DB_HOSTNAME}:${DB_PORT}/${HASURA_DB_NAME}
4343
HASURA_GRAPHQL_ENABLE_CONSOLE: "true"
4444
HASURA_GRAPHQL_ADMIN_SECRET: ${HASURA_ADMIN_SECRET}
45-
HASURA_GRAPHQL_UNAUTHORIZED_ROLE: ${HASURA_UNAUTHORIZED_ROLE}
46-
HASURA_GRAPHQL_JWT_SECRET: '{"type": "RS256", "jwk_url": "https://www.googleapis.com/service_accounts/v1/jwk/[email protected]", "audience": "react-admin-low-code", "issuer": "https://securetoken.google.com/react-admin-low-code"}'
45+
HASURA_GRAPHQL_UNAUTHORIZED_ROLE: "anonymous"
46+
HASURA_GRAPHQL_JWT_SECRET: '{"type":"RS256","jwk_url": "https://www.googleapis.com/service_accounts/v1/jwk/[email protected]", "audience": "react-admin-low-code", "issuer": "https://securetoken.google.com/react-admin-low-code"}'
4747
HASURA_GRAPHQL_LOG_LEVEL: debug
48-
HASURA_GRAPHQL_ENABLED_LOG_TYPES: query-log
48+
HASURA_GRAPHQL_ENABLED_LOG_TYPES: startup, http-log, webhook-log, websocket-log, query-log
49+
HASURA_GRAPHQL_CORS_DOMAIN: "*"
4950
graphql-migrations:
5051
image: dvasdekis/hasura-cli-docker:latest
5152
depends_on:

firebase/functions/README.md renamed to firebase/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@ and are committed to Firebase with console `npm install && firebase deploy --onl
66
To redeploy firebase functions:
77

88
`
9-
gcloud sql users set-password firebase_function_user --instance="your-gcloud-db" --password="firebase_function_password" && firebase --project "react-admin-low-code" functions:config:set database.ip="/cloudsql/hedgecheap-test:us-central1:your-gcloud-db" database.dbname="postgres" database.user="firebase_function_user" database.password="firebase_function_password" database.port=5432 && firebase deploy --only functions
9+
gcloud sql users set-password firebase_function_user --instance="your-gcloud-db" --password="firebase_function_password" && firebase --project "react-admin-low-code" functions:config:set database.ip="/cloudsql/react-admin-low-code:us-central1:your-gcloud-db" database.dbname="postgres" database.user="firebase_function_user" database.password="firebase_function_password" database.port=5432 && firebase deploy --only functions
1010
`

firebase/functions/index.js

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,16 @@
33
// and is committed to Firebase with console `firebase deploy --only functions`
44
const functions = require("firebase-functions");
55
const admin = require("firebase-admin");
6-
const { Pool } = require('pg');
6+
// const { Pool } = require('pg');
77
admin.initializeApp(functions.config().firebase);
8-
9-
const pool = new Pool({
10-
user: functions.config().database.user,
11-
host: functions.config().database.ip,
12-
database: functions.config().database.dbname,
13-
password: functions.config().database.password,
14-
port: functions.config().database.port,
15-
});
8+
//
9+
// const pool = new Pool({
10+
// user: functions.config().database.user,
11+
// host: functions.config().database.ip,
12+
// database: functions.config().database.dbname,
13+
// password: functions.config().database.password,
14+
// port: functions.config().database.port,
15+
// });
1616

1717

1818
// On sign up.
@@ -50,8 +50,5 @@ exports.processSignUp = functions.auth.user().onCreate(user => {
5050
// Set the refresh time to the current UTC timestamp.
5151
// This will be captured on the client to force a token refresh.
5252
return metadataRef.set({ refreshTime: new Date().getTime() });
53-
}).then
54-
.catch(error => {
55-
console.log(error);
56-
});
53+
});
5754
});

firebase/functions/package-lock.json

Lines changed: 93 additions & 79 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)