diff options
author | Corey Hulen <corey@hulen.com> | 2016-09-21 04:17:58 -0700 |
---|---|---|
committer | Joram Wilander <jwawilander@gmail.com> | 2016-09-21 07:17:58 -0400 |
commit | fc5df5c4356c56287de19f36f59495cb20851c79 (patch) | |
tree | 1989787b7d10ce6d23c3242ad6b5ad82679fd453 /api/user.go | |
parent | 3ecbfd97167fc2d57a4062530a6e163cd099904c (diff) | |
download | chat-fc5df5c4356c56287de19f36f59495cb20851c79.tar.gz chat-fc5df5c4356c56287de19f36f59495cb20851c79.tar.bz2 chat-fc5df5c4356c56287de19f36f59495cb20851c79.zip |
Fix issue when saving session has an error (#4053)
* Fix issue is saving session has an error
* Fixing break break
Diffstat (limited to 'api/user.go')
-rw-r--r-- | api/user.go | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/api/user.go b/api/user.go index a82fc5561..c0fe403b3 100644 --- a/api/user.go +++ b/api/user.go @@ -487,6 +487,9 @@ func login(c *Context, w http.ResponseWriter, r *http.Request) { c.LogAuditWithUserId(user.Id, "success") doLogin(c, w, r, user, deviceId) + if c.Err != nil { + return + } user.Sanitize(map[string]bool{}) @@ -554,6 +557,9 @@ func LoginByOAuth(c *Context, w http.ResponseWriter, r *http.Request, service st } else { user = result.Data.(*model.User) doLogin(c, w, r, user, "") + if c.Err != nil { + return nil + } return user } } @@ -2544,6 +2550,9 @@ func completeSaml(c *Context, w http.ResponseWriter, r *http.Request) { break } doLogin(c, w, r, user, "") + if c.Err != nil { + return + } if val, ok := relayProps["redirect_to"]; ok { http.Redirect(w, r, c.GetSiteURL()+val, http.StatusFound) |