community(sample-apps): update firebase-jwt functions (#4057)

This commit is contained in:
Ahmet Simsek 2020-04-01 04:15:23 +03:00 committed by GitHub
parent 58ba01f31c
commit 89aaf1a750
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -8,7 +8,7 @@ exports.processSignUp = functions.auth.user().onCreate(user => {
// Check if user meets role criteria: // Check if user meets role criteria:
// Your custom logic here: to decide what roles and other `x-hasura-*` should the user get // Your custom logic here: to decide what roles and other `x-hasura-*` should the user get
let customClaims; let customClaims;
if (user.email && user.email.indexOf('@hasura.io') != -1) { if (user.email && user.email.indexOf('@hasura.io') !== -1) {
customClaims = { customClaims = {
'https://hasura.io/jwt/claims': { 'https://hasura.io/jwt/claims': {
'x-hasura-default-role': 'admin', 'x-hasura-default-role': 'admin',