Skip to content

Commit

Permalink
Merge pull request auth0-extensions#50 from zxan1285/user-metadata
Browse files Browse the repository at this point in the history
Undefined user_metadata fixed
  • Loading branch information
fyockm authored Jun 27, 2018
2 parents b643197 + f7f635e commit 5343c14
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 4 deletions.
3 changes: 2 additions & 1 deletion api/get_index.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,8 @@ module.exports = () => ({
fetchUsersFromToken(token)
.then(({ currentUser, matchingUsers }) => {
getSettings().then((settings) => {
const locale = matchingUsers[0].user_metadata.locale || settings.locale;
const userMetadata = (matchingUsers[0] && matchingUsers[0].user_metadata) || {};
const locale = userMetadata.locale || settings.locale;
resolveLocale(locale).then((t) => {
const rawIdentities = matchingUsers.length > 0 ? matchingUsers[0].identities : [];
const identities = rawIdentities
Expand Down
2 changes: 1 addition & 1 deletion build/bundle.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "auth0-account-link-extension",
"version": "2.3.2",
"version": "2.3.3",
"description": "Auth0 Account Link Extension",
"main": "index.js",
"engines": {
Expand Down
2 changes: 1 addition & 1 deletion webtask.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"title": "Auth0 Account Link",
"name": "auth0-account-link",
"version": "2.3.2",
"version": "2.3.3",
"preVersion": "2.1.1",
"author": "auth0",
"description":
Expand Down

0 comments on commit 5343c14

Please sign in to comment.