Reformat all project files to use the prettier config file.
This commit is contained in:
@@ -1,7 +1,5 @@
|
||||
{
|
||||
"functions": {
|
||||
"predeploy": [
|
||||
"npm --prefix \"$RESOURCE_DIR\" run lint"
|
||||
]
|
||||
"predeploy": ["npm --prefix \"$RESOURCE_DIR\" run lint"]
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,28 +4,27 @@ admin.initializeApp(functions.config().firebase);
|
||||
|
||||
// On sign up.
|
||||
exports.processSignUp = functions.auth.user().onCreate((user) => {
|
||||
// Check if user meets role criteria:
|
||||
// Your custom logic here: to decide what roles and other `x-hasura-*` should the user get
|
||||
let customClaims;
|
||||
if (user.email && user.email.indexOf("@admin.imex.online") !== -1) {
|
||||
customClaims = {
|
||||
"https://hasura.io/jwt/claims": {
|
||||
"x-hasura-default-role": "admin",
|
||||
"x-hasura-allowed-roles": ["user", "admin"],
|
||||
"x-hasura-user-id": user.uid,
|
||||
},
|
||||
};
|
||||
} else {
|
||||
customClaims = {
|
||||
"https://hasura.io/jwt/claims": {
|
||||
"x-hasura-default-role": "user",
|
||||
"x-hasura-allowed-roles": ["user"],
|
||||
"x-hasura-user-id": user.uid,
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
// Set custom user claims on this newly created user.
|
||||
return admin.auth().setCustomUserClaims(user.uid, customClaims);
|
||||
// Check if user meets role criteria:
|
||||
// Your custom logic here: to decide what roles and other `x-hasura-*` should the user get
|
||||
let customClaims;
|
||||
if (user.email && user.email.indexOf("@admin.imex.online") !== -1) {
|
||||
customClaims = {
|
||||
"https://hasura.io/jwt/claims": {
|
||||
"x-hasura-default-role": "admin",
|
||||
"x-hasura-allowed-roles": ["user", "admin"],
|
||||
"x-hasura-user-id": user.uid
|
||||
}
|
||||
};
|
||||
} else {
|
||||
customClaims = {
|
||||
"https://hasura.io/jwt/claims": {
|
||||
"x-hasura-default-role": "user",
|
||||
"x-hasura-allowed-roles": ["user"],
|
||||
"x-hasura-user-id": user.uid
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
// Set custom user claims on this newly created user.
|
||||
return admin.auth().setCustomUserClaims(user.uid, customClaims);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user