diff options
author | David Lu <david.lu@hotmail.com> | 2016-06-14 05:59:55 -0700 |
---|---|---|
committer | Joram Wilander <jwawilander@gmail.com> | 2016-06-14 08:59:55 -0400 |
commit | 661f221727109f2298812fea89347bfeaf984109 (patch) | |
tree | 8f95bfb688a43b4b9b5ea7dd6cdb3ef34df94521 /api/user.go | |
parent | 1d67825673e4e5f1b90b18b7138953baedce3108 (diff) | |
download | chat-661f221727109f2298812fea89347bfeaf984109.tar.gz chat-661f221727109f2298812fea89347bfeaf984109.tar.bz2 chat-661f221727109f2298812fea89347bfeaf984109.zip |
Made error message clearer (#3318)
Diffstat (limited to 'api/user.go')
-rw-r--r-- | api/user.go | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/api/user.go b/api/user.go index aae3dffa5..0ab64d830 100644 --- a/api/user.go +++ b/api/user.go @@ -301,8 +301,14 @@ func CreateOAuthUser(c *Context, w http.ResponseWriter, r *http.Request, service } if result := <-euchan; result.Err == nil { - c.Err = model.NewLocAppError("CreateOAuthUser", "api.user.create_oauth_user.already_attached.app_error", - map[string]interface{}{"Service": service}, "email="+user.Email) + authService := result.Data.(*model.User).AuthService + if authService == "" { + c.Err = model.NewLocAppError("CreateOAuthUser", "api.user.create_oauth_user.already_attached.app_error", + map[string]interface{}{"Service": service, "Auth": model.USER_AUTH_SERVICE_EMAIL}, "email="+user.Email) + } else { + c.Err = model.NewLocAppError("CreateOAuthUser", "api.user.create_oauth_user.already_attached.app_error", + map[string]interface{}{"Service": service, "Auth": authService}, "email="+user.Email) + } return nil } |