summaryrefslogtreecommitdiffstats
path: root/vendor/github.com/mattermost/platform/model/gitlab
diff options
context:
space:
mode:
authorWim <wim@42.be>2016-05-15 23:02:30 +0200
committerWim <wim@42.be>2016-05-15 23:02:30 +0200
commit59e6abcc11ed3a3548ffb02d1e455485672d8308 (patch)
treea5086741b8595d7eb33a0f41e7c109d064be33ef /vendor/github.com/mattermost/platform/model/gitlab
parent38e3bbe5c96eb84f3e223c44f801ee7e3308b2c1 (diff)
downloadmatterbridge-msglm-59e6abcc11ed3a3548ffb02d1e455485672d8308.tar.gz
matterbridge-msglm-59e6abcc11ed3a3548ffb02d1e455485672d8308.tar.bz2
matterbridge-msglm-59e6abcc11ed3a3548ffb02d1e455485672d8308.zip
Sync with mattermost 3.0
Diffstat (limited to 'vendor/github.com/mattermost/platform/model/gitlab')
-rw-r--r--vendor/github.com/mattermost/platform/model/gitlab/gitlab.go13
1 files changed, 5 insertions, 8 deletions
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 {