Make sure we always set a name on commits

This commit is contained in:
Mathias Biilmann Christensen 2017-09-06 18:14:59 -07:00
parent 2e4dfb33b6
commit bea470518e

View File

@ -33,7 +33,7 @@ export default class GitGateway extends GitHubBackend {
constructor(config) { constructor(config) {
super(config, true); 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 netlifySiteURL = localStorage.getItem("netlifySiteURL");
const APIUrl = getEndpoint(config.getIn(["backend", "identity_url"], defaults.identity), 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', []); const userRoles = get(jwtDecode(token), 'app_metadata.roles', []);
if (validRole) { if (validRole) {
const userData = { const userData = {
name: user.user_metadata.name, name: user.user_metadata.name || user.email.split('@').shift(),
email: user.email, email: user.email,
metadata: user.user_metadata, metadata: user.user_metadata,
}; };