mirror of
https://github.com/mattermost/mattermost.git
synced 2026-05-28 04:35:04 -04:00
Fix errcheck issue in oauth.go (#28795)
This commit is contained in:
parent
f2182d806b
commit
be7a8a17c0
3 changed files with 12 additions and 3 deletions
|
|
@ -246,7 +246,6 @@ issues:
|
|||
channels/store/storetest/user_store.go|\
|
||||
channels/testlib/helper.go|\
|
||||
channels/utils/license_test.go|\
|
||||
channels/web/oauth.go|\
|
||||
channels/web/oauth_test.go|\
|
||||
channels/web/saml.go|\
|
||||
channels/web/static.go|\
|
||||
|
|
|
|||
|
|
@ -78,7 +78,10 @@ func authorizeOAuthApp(c *Context, w http.ResponseWriter, r *http.Request) {
|
|||
auditRec.Success()
|
||||
c.LogAudit("success")
|
||||
|
||||
w.Write([]byte(model.MapToJSON(map[string]string{"redirect": redirectURL})))
|
||||
_, err = w.Write([]byte(model.MapToJSON(map[string]string{"redirect": redirectURL})))
|
||||
if err != nil {
|
||||
c.Logger.Error("Error writing response", mlog.Err(err))
|
||||
}
|
||||
}
|
||||
|
||||
func deauthorizeOAuthApp(c *Context, w http.ResponseWriter, r *http.Request) {
|
||||
|
|
@ -201,7 +204,10 @@ func authorizeOAuthPage(c *Context, w http.ResponseWriter, r *http.Request) {
|
|||
}
|
||||
|
||||
func getAccessToken(c *Context, w http.ResponseWriter, r *http.Request) {
|
||||
r.ParseForm()
|
||||
if err := r.ParseForm(); err != nil {
|
||||
c.Err = model.NewAppError("getAccessToken", "api.oauth.get_access_token.bad_request.app_error", nil, "", http.StatusBadRequest)
|
||||
return
|
||||
}
|
||||
|
||||
code := r.FormValue("code")
|
||||
refreshToken := r.FormValue("refresh_token")
|
||||
|
|
|
|||
|
|
@ -2360,6 +2360,10 @@
|
|||
"id": "api.oauth.get_access_token.bad_grant.app_error",
|
||||
"translation": "invalid_request: Bad grant_type."
|
||||
},
|
||||
{
|
||||
"id": "api.oauth.get_access_token.bad_request.app_error",
|
||||
"translation": "invalid_request: Bad request."
|
||||
},
|
||||
{
|
||||
"id": "api.oauth.get_access_token.credentials.app_error",
|
||||
"translation": "invalid_client: Invalid client credentials."
|
||||
|
|
|
|||
Loading…
Reference in a new issue