summaryrefslogtreecommitdiffstats
path: root/web
diff options
context:
space:
mode:
authorJoramWilander <jwawilander@gmail.com>2015-07-22 11:26:55 -0400
committerJoramWilander <jwawilander@gmail.com>2015-07-22 11:26:55 -0400
commita2bd8b8676701ee5ccf5d84a2f4fe6afb0dae4b1 (patch)
treebc57fb398cd6069893388c454f71e5e015d97fc8 /web
parent7635e646a007123f989ba5c5747c4af1ebd27178 (diff)
downloadchat-a2bd8b8676701ee5ccf5d84a2f4fe6afb0dae4b1.tar.gz
chat-a2bd8b8676701ee5ccf5d84a2f4fe6afb0dae4b1.tar.bz2
chat-a2bd8b8676701ee5ccf5d84a2f4fe6afb0dae4b1.zip
add error for trying to sign up with the same oauth account twice
Diffstat (limited to 'web')
-rw-r--r--web/web.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/web/web.go b/web/web.go
index 15c978ff1..ef2bae624 100644
--- a/web/web.go
+++ b/web/web.go
@@ -499,6 +499,11 @@ func signupCompleteOAuth(c *api.Context, w http.ResponseWriter, r *http.Request)
return
}
+ if result := <-api.Srv.Store.User().GetByAuth(team.Id, user.AuthData, service); result.Err == nil {
+ c.Err = model.NewAppError("signupCompleteOAuth", "This "+service+" account has already been used to sign up for team "+team.DisplayName, "email="+user.Email)
+ return
+ }
+
if result := <-api.Srv.Store.User().GetByEmail(team.Id, user.Email); result.Err == nil {
c.Err = model.NewAppError("signupCompleteOAuth", "Team "+team.DisplayName+" already has a user with the email address attached to your "+service+" account", "email="+user.Email)
return