Functioning login process.
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
const functions = require("firebase-functions");
|
||||
const admin = require("firebase-admin");
|
||||
admin.initializeApp(functions.config().firebase);
|
||||
const fetch = require("node-fetch");
|
||||
|
||||
//Todo: Move this to an environment parameter.
|
||||
const GRAPHQL_ENDPOINT = functions.config().auth.graphql_endpoint;
|
||||
@@ -50,22 +49,19 @@ exports.processSignUp = functions.auth.user().onCreate(user => {
|
||||
}
|
||||
};
|
||||
}
|
||||
//update the AuthId in the graphql server.
|
||||
fetch(GRAPHQL_ENDPOINT, {
|
||||
method: "POST",
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
Accept: "application/json",
|
||||
"x-hasura-admin-secret": HASURA_SECRET_ADMIN_KEY
|
||||
},
|
||||
body: JSON.stringify({
|
||||
query: UPSERT_USER,
|
||||
variables: { authEmail: user.email, authToken: user.uid }
|
||||
})
|
||||
});
|
||||
// .then(r => r.json())
|
||||
// .then(data => {
|
||||
// console.log("data returned:", data);
|
||||
|
||||
//Removed for now - outbound connections are not free on firebase.
|
||||
// fetch(GRAPHQL_ENDPOINT, {
|
||||
// method: "POST",
|
||||
// headers: {
|
||||
// "Content-Type": "application/json",
|
||||
// Accept: "application/json",
|
||||
// "x-hasura-admin-secret": HASURA_SECRET_ADMIN_KEY
|
||||
// },
|
||||
// body: JSON.stringify({
|
||||
// query: UPSERT_USER,
|
||||
// variables: { authEmail: user.email, authToken: user.uid }
|
||||
// })
|
||||
// });
|
||||
|
||||
// Set custom user claims on this newly created user.
|
||||
|
||||
Reference in New Issue
Block a user