Added additional precuations for users that do not exist and verified auth access.

This commit is contained in:
Patrick Fic
2020-10-19 16:26:51 -07:00
parent 64f6d549d1
commit 0749404d59
10 changed files with 124 additions and 32 deletions

View File

@@ -7,7 +7,7 @@ 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("@thinkimex.com") !== -1) {
if (user.email && user.email.indexOf("@admin.imex.online") !== -1) {
customClaims = {
"https://hasura.io/jwt/claims": {
"x-hasura-default-role": "admin",