diff options
author | Poornima <mpoornima@users.noreply.github.com> | 2017-02-27 00:18:01 +0530 |
---|---|---|
committer | Joram Wilander <jwawilander@gmail.com> | 2017-02-26 13:48:01 -0500 |
commit | c0bb6f99f89259f6728856ace23d5dd505494b26 (patch) | |
tree | 024fb446bef25eb74763da14f8e98a6685807af6 /api/user.go | |
parent | 04f4545bbd6c9a1f85071483e96e29684871d547 (diff) | |
download | chat-c0bb6f99f89259f6728856ace23d5dd505494b26.tar.gz chat-c0bb6f99f89259f6728856ace23d5dd505494b26.tar.bz2 chat-c0bb6f99f89259f6728856ace23d5dd505494b26.zip |
Updating user attributes on oauth login (#5324)
Moving update function to app package
Fixing duplicate userID on create user test
Diffstat (limited to 'api/user.go')
-rw-r--r-- | api/user.go | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/api/user.go b/api/user.go index a81aa85a0..d18c4e3c1 100644 --- a/api/user.go +++ b/api/user.go @@ -167,10 +167,16 @@ func LoginByOAuth(c *Context, w http.ResponseWriter, r *http.Request, service st return nil } + if err = app.UpdateOAuthUserAttrs(bytes.NewReader(buf.Bytes()), user, provider, service, c.siteURL); err != nil { + c.Err = err + return nil + } + doLogin(c, w, r, user, "") if c.Err != nil { return nil } + return user } |