Этот коммит содержится в:
TheInvincible
2024-11-04 09:07:04 +01:00
коммит произвёл GitHub
родитель f2182d806b
Коммит be7a8a17c0
3 изменённых файлов: 12 добавлений и 3 удалений

Просмотреть файл

@@ -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."