summaryrefslogtreecommitdiffstats
path: root/api/oauth.go
diff options
context:
space:
mode:
authorChristopher Speller <crspeller@gmail.com>2016-05-12 12:11:02 -0400
committerChristopher Speller <crspeller@gmail.com>2016-05-12 12:11:02 -0400
commitd1efb66ad7b017f0fbfe6f0c20843b30f396e504 (patch)
tree5b48a38382015de815b2d45d58836c5ca06b631c /api/oauth.go
parent3f0325fd223dcb3a6eec92f772df1e7541ab0b2b (diff)
parent9a701b7e5b31ca803a2d92f0b3b1d7cc68bf3c37 (diff)
downloadchat-d1efb66ad7b017f0fbfe6f0c20843b30f396e504.tar.gz
chat-d1efb66ad7b017f0fbfe6f0c20843b30f396e504.tar.bz2
chat-d1efb66ad7b017f0fbfe6f0c20843b30f396e504.zip
Merge branch 'release-3.0'
Diffstat (limited to 'api/oauth.go')
-rw-r--r--api/oauth.go7
1 files changed, 5 insertions, 2 deletions
diff --git a/api/oauth.go b/api/oauth.go
index 0375f4e6f..37ca5ce0a 100644
--- a/api/oauth.go
+++ b/api/oauth.go
@@ -600,8 +600,11 @@ func CompleteSwitchWithOAuth(c *Context, w http.ResponseWriter, r *http.Request,
return
} else {
ssoUser := provider.GetUserFromJson(userData)
- authData = ssoUser.AuthData
ssoEmail = ssoUser.Email
+
+ if ssoUser.AuthData != nil {
+ authData = *ssoUser.AuthData
+ }
}
if len(authData) == 0 {
@@ -628,7 +631,7 @@ func CompleteSwitchWithOAuth(c *Context, w http.ResponseWriter, r *http.Request,
return
}
- if result := <-Srv.Store.User().UpdateAuthData(user.Id, service, authData, ssoEmail); result.Err != nil {
+ if result := <-Srv.Store.User().UpdateAuthData(user.Id, service, &authData, ssoEmail); result.Err != nil {
c.Err = result.Err
return
}