From 661f221727109f2298812fea89347bfeaf984109 Mon Sep 17 00:00:00 2001 From: David Lu Date: Tue, 14 Jun 2016 05:59:55 -0700 Subject: Made error message clearer (#3318) --- api/user.go | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'api/user.go') 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 } -- cgit v1.2.3-1-g7c22