Skip to content

Commit

Permalink
skip user fields that is either undefined or null
Browse files Browse the repository at this point in the history
  • Loading branch information
elitan committed Jan 14, 2020
1 parent a2f9baa commit 2ecf693
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/auth/auth-functions.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ module.exports = {
let custom_claims = {};

USER_FIELDS.forEach(user_field => {

if (typeof user[user_field] === undefined || user[user_field] === null) {

This comment has been minimized.

Copy link
@dlee

dlee Feb 5, 2020

undefined should be quoted: 'undefined'.

This comment has been minimized.

Copy link
@elitan

elitan Feb 6, 2020

Author Contributor

Thanks. Fixed in d578403

return null;
}

custom_claims['x-hasura-' + user_field.replace('_', '-')] = user[user_field] && user[user_field].toString();
});

Expand Down

0 comments on commit 2ecf693

Please sign in to comment.