Commit 1d7f9452 by Garrett Bjerkhoel

Handle special error case if connect.UserInfo returns an error

parent eb37fc08
......@@ -45,7 +45,11 @@ func OAuthLogin(ctx *middleware.Context) {
userInfo, err := connect.UserInfo(token)
if err != nil {
ctx.Handle(500, fmt.Sprintf("login.OAuthLogin(get info from %s)", name), err)
if err == social.ErrMissingTeamMembership {
ctx.Redirect(setting.AppSubUrl + "/login?missing_team_membership=1")
} else {
ctx.Handle(500, fmt.Sprintf("login.OAuthLogin(get info from %s)", name), err)
}
return
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment