From c9e9484150fcc05ca12388c6db8b831c41f227eb Mon Sep 17 00:00:00 2001 From: Elias Nahum Date: Thu, 22 Mar 2018 19:46:30 +0200 Subject: MM-9853 Fix Team invite does not carry through SAML login (#8495) --- api/user.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'api') diff --git a/api/user.go b/api/user.go index 14cc881dc..560d722a4 100644 --- a/api/user.go +++ b/api/user.go @@ -1170,7 +1170,11 @@ func completeSaml(c *Context, w http.ResponseWriter, r *http.Request) { teamId := relayProps["team_id"] if len(teamId) > 0 { c.App.Go(func() { - c.App.AddDirectChannels(teamId, user) + if err := c.App.AddUserToTeamByTeamId(teamId, user); err != nil { + l4g.Error(err.Error()) + } else { + c.App.AddDirectChannels(teamId, user) + } }) } case model.OAUTH_ACTION_EMAIL_TO_SSO: -- cgit v1.2.3-1-g7c22