Commit 151fe240 by Maxim Ivanov Committed by Carl Bergquist

OAuth: Fix for wrong user token updated on OAuth refresh in DS proxy (#17541)

parent 599514ad
...@@ -354,7 +354,7 @@ func addOAuthPassThruAuth(c *m.ReqContext, req *http.Request) { ...@@ -354,7 +354,7 @@ func addOAuthPassThruAuth(c *m.ReqContext, req *http.Request) {
// If the tokens are not the same, update the entry in the DB // If the tokens are not the same, update the entry in the DB
if token.AccessToken != authInfoQuery.Result.OAuthAccessToken { if token.AccessToken != authInfoQuery.Result.OAuthAccessToken {
updateAuthCommand := &m.UpdateAuthInfoCommand{ updateAuthCommand := &m.UpdateAuthInfoCommand{
UserId: authInfoQuery.Result.Id, UserId: authInfoQuery.Result.UserId,
AuthModule: authInfoQuery.Result.AuthModule, AuthModule: authInfoQuery.Result.AuthModule,
AuthId: authInfoQuery.Result.AuthId, AuthId: authInfoQuery.Result.AuthId,
OAuthToken: token, OAuthToken: token,
......
...@@ -241,8 +241,8 @@ func UpdateAuthInfo(cmd *models.UpdateAuthInfoCommand) error { ...@@ -241,8 +241,8 @@ func UpdateAuthInfo(cmd *models.UpdateAuthInfoCommand) error {
UserId: cmd.UserId, UserId: cmd.UserId,
AuthModule: cmd.AuthModule, AuthModule: cmd.AuthModule,
} }
upd, err := sess.Update(authUser, cond)
_, err := sess.Update(authUser, cond) sqlog.Debug("Updated user_auth", "user_id", cmd.UserId, "auth_module", cmd.AuthModule, "rows", upd)
return err return err
}) })
} }
......
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