summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Lu <david.lu@hotmail.com>2016-06-14 05:59:55 -0700
committerJoram Wilander <jwawilander@gmail.com>2016-06-14 08:59:55 -0400
commit661f221727109f2298812fea89347bfeaf984109 (patch)
tree8f95bfb688a43b4b9b5ea7dd6cdb3ef34df94521
parent1d67825673e4e5f1b90b18b7138953baedce3108 (diff)
downloadchat-661f221727109f2298812fea89347bfeaf984109.tar.gz
chat-661f221727109f2298812fea89347bfeaf984109.tar.bz2
chat-661f221727109f2298812fea89347bfeaf984109.zip
Made error message clearer (#3318)
-rw-r--r--api/user.go10
-rw-r--r--i18n/en.json2
2 files changed, 9 insertions, 3 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
}
diff --git a/i18n/en.json b/i18n/en.json
index 1589dd4ac..0f24ff03a 100644
--- a/i18n/en.json
+++ b/i18n/en.json
@@ -1561,7 +1561,7 @@
},
{
"id": "api.user.create_oauth_user.already_attached.app_error",
- "translation": "An existing user is already attached to your {{.Service}} account"
+ "translation": "There is already an account associated with that email address using a sign in method other than {{.Service}}. Please sign in using {{.Auth}}."
},
{
"id": "api.user.create_oauth_user.already_used.app_error",