summaryrefslogtreecommitdiffstats
path: root/model/gitlab
diff options
context:
space:
mode:
authorJoram Wilander <jwawilander@gmail.com>2017-02-23 03:53:33 -0500
committerGeorge Goldberg <george@gberg.me>2017-02-23 08:53:33 +0000
commit9220254f05b6200de2e8ac78476a8df536c821ec (patch)
tree9fc67b94e25e65ebe85ddef1b0b5a4df6fe263dc /model/gitlab
parent7883a515e72690e08e10d38fafc741da1e7a0deb (diff)
downloadchat-9220254f05b6200de2e8ac78476a8df536c821ec.tar.gz
chat-9220254f05b6200de2e8ac78476a8df536c821ec.tar.bz2
chat-9220254f05b6200de2e8ac78476a8df536c821ec.zip
Block OAuth account creation when disabled in config (#5506)
Diffstat (limited to 'model/gitlab')
-rw-r--r--model/gitlab/gitlab.go9
1 files changed, 9 insertions, 0 deletions
diff --git a/model/gitlab/gitlab.go b/model/gitlab/gitlab.go
index e189ee68d..270d62d8b 100644
--- a/model/gitlab/gitlab.go
+++ b/model/gitlab/gitlab.go
@@ -65,6 +65,15 @@ func gitLabUserFromJson(data io.Reader) *GitLabUser {
}
}
+func (glu *GitLabUser) ToJson() string {
+ b, err := json.Marshal(glu)
+ if err != nil {
+ return ""
+ } else {
+ return string(b)
+ }
+}
+
func (glu *GitLabUser) IsValid() bool {
if glu.Id == 0 {
return false