From bea470518e5c6d96ac6a3c145de2ef9c470db4de Mon Sep 17 00:00:00 2001 From: Mathias Biilmann Christensen Date: Wed, 6 Sep 2017 18:14:59 -0700 Subject: [PATCH] Make sure we always set a name on commits --- src/backends/git-gateway/implementation.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/backends/git-gateway/implementation.js b/src/backends/git-gateway/implementation.js index 0a1f11e5..63cad35e 100644 --- a/src/backends/git-gateway/implementation.js +++ b/src/backends/git-gateway/implementation.js @@ -33,7 +33,7 @@ export default class GitGateway extends GitHubBackend { constructor(config) { super(config, true); - this.accept_roles = (config.getIn(["backend", "accept_roles"]) || List()).toArray(); + this.accept_roles = (config.getIn(["backend", "accept_roles"]) || new List()).toArray(); const netlifySiteURL = localStorage.getItem("netlifySiteURL"); const APIUrl = getEndpoint(config.getIn(["backend", "identity_url"], defaults.identity), netlifySiteURL); @@ -60,7 +60,7 @@ export default class GitGateway extends GitHubBackend { const userRoles = get(jwtDecode(token), 'app_metadata.roles', []); if (validRole) { const userData = { - name: user.user_metadata.name, + name: user.user_metadata.name || user.email.split('@').shift(), email: user.email, metadata: user.user_metadata, };