diff options
author | =Corey Hulen <corey@hulen.com> | 2016-01-20 08:56:09 -0600 |
---|---|---|
committer | =Corey Hulen <corey@hulen.com> | 2016-01-20 08:56:09 -0600 |
commit | 640d3018c9a75e7c85da55c3483396e31a6de994 (patch) | |
tree | 7b8190f82ca9bafbdea6aa3b2b3da216897ea784 /web/web.go | |
parent | ef11df753227f3082d5c2226c0e7525e14ed47c7 (diff) | |
download | chat-640d3018c9a75e7c85da55c3483396e31a6de994.tar.gz chat-640d3018c9a75e7c85da55c3483396e31a6de994.tar.bz2 chat-640d3018c9a75e7c85da55c3483396e31a6de994.zip |
PLT-7 adding loc db calls for oauth table
Diffstat (limited to 'web/web.go')
-rw-r--r-- | web/web.go | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/web/web.go b/web/web.go index c7a7b8666..a98b213be 100644 --- a/web/web.go +++ b/web/web.go @@ -846,7 +846,7 @@ func authorizeOAuth(c *api.Context, w http.ResponseWriter, r *http.Request) { } var app *model.OAuthApp - if result := <-api.Srv.Store.OAuth().GetApp(clientId); result.Err != nil { + if result := <-api.Srv.Store.OAuth().GetApp(c.T, clientId); result.Err != nil { c.Err = result.Err return } else { @@ -909,10 +909,10 @@ func getAccessToken(c *api.Context, w http.ResponseWriter, r *http.Request) { redirectUri := r.FormValue("redirect_uri") - achan := api.Srv.Store.OAuth().GetApp(clientId) - tchan := api.Srv.Store.OAuth().GetAccessDataByAuthCode(code) + achan := api.Srv.Store.OAuth().GetApp(c.T, clientId) + tchan := api.Srv.Store.OAuth().GetAccessDataByAuthCode(c.T, code) - authData := api.GetAuthData(code) + authData := api.GetAuthData(c.T, code) if authData == nil { c.LogAudit("fail - invalid auth code") @@ -967,7 +967,7 @@ func getAccessToken(c *api.Context, w http.ResponseWriter, r *http.Request) { accessData := result.Data.(*model.AccessData) // Revoke access token, related auth code, and session from DB as well as from cache - if err := api.RevokeAccessToken(accessData.Token); err != nil { + if err := api.RevokeAccessToken(c.T, accessData.Token); err != nil { l4g.Error("Encountered an error revoking an access token, err=" + err.Message) } @@ -995,7 +995,7 @@ func getAccessToken(c *api.Context, w http.ResponseWriter, r *http.Request) { accessData := &model.AccessData{AuthCode: authData.Code, Token: session.Token, RedirectUri: callback} - if result := <-api.Srv.Store.OAuth().SaveAccessData(accessData); result.Err != nil { + if result := <-api.Srv.Store.OAuth().SaveAccessData(c.T, accessData); result.Err != nil { l4g.Error(result.Err) c.Err = model.NewAppError("getAccessToken", "server_error: Encountered internal server error while saving access token to database", "") return |