From 59e6abcc11ed3a3548ffb02d1e455485672d8308 Mon Sep 17 00:00:00 2001 From: Wim Date: Sun, 15 May 2016 23:02:30 +0200 Subject: Sync with mattermost 3.0 --- .../github.com/mattermost/platform/model/gitlab/gitlab.go | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) (limited to 'vendor/github.com/mattermost/platform/model/gitlab') diff --git a/vendor/github.com/mattermost/platform/model/gitlab/gitlab.go b/vendor/github.com/mattermost/platform/model/gitlab/gitlab.go index 3ca49997..fc70dd93 100644 --- a/vendor/github.com/mattermost/platform/model/gitlab/gitlab.go +++ b/vendor/github.com/mattermost/platform/model/gitlab/gitlab.go @@ -12,10 +12,6 @@ import ( "strings" ) -const ( - USER_AUTH_SERVICE_GITLAB = "gitlab" -) - type GitLabProvider struct { } @@ -29,7 +25,7 @@ type GitLabUser struct { func init() { provider := &GitLabProvider{} - einterfaces.RegisterOauthProvider(USER_AUTH_SERVICE_GITLAB, provider) + einterfaces.RegisterOauthProvider(model.USER_AUTH_SERVICE_GITLAB, provider) } func userFromGitLabUser(glu *GitLabUser) *model.User { @@ -49,9 +45,10 @@ func userFromGitLabUser(glu *GitLabUser) *model.User { } else { user.FirstName = glu.Name } + strings.TrimSpace(user.Email) user.Email = glu.Email - user.AuthData = strconv.FormatInt(glu.Id, 10) - user.AuthService = USER_AUTH_SERVICE_GITLAB + *user.AuthData = strconv.FormatInt(glu.Id, 10) + user.AuthService = model.USER_AUTH_SERVICE_GITLAB return user } @@ -84,7 +81,7 @@ func (glu *GitLabUser) getAuthData() string { } func (m *GitLabProvider) GetIdentifier() string { - return USER_AUTH_SERVICE_GITLAB + return model.USER_AUTH_SERVICE_GITLAB } func (m *GitLabProvider) GetUserFromJson(data io.Reader) *model.User { -- cgit v1.2.3