Remove FromJSON functions (Part 1) (#17961)
* Remove FromJSON functions (Part 1) ```release-note Removed the following functions: AccessDataFromJson AccessResponseFromJson AnalyticsRowFromJson AnalyticsRowsFromJson AuditFromJson AuditsFromJson AuthDataFromJson AuthorizeRequestFromJson BotFromJson BotPatchFromJson BotListFromJson ``` * fix tests ```release-note NONE ```
Этот коммит содержится в:
коммит произвёл
Claudio Costa
родитель
7454680be5
Коммит
e199eba313
13
web/oauth.go
13
web/oauth.go
@@ -4,6 +4,7 @@
|
||||
package web
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"html"
|
||||
"net/http"
|
||||
"net/url"
|
||||
@@ -44,8 +45,9 @@ func testHandler(c *Context, w http.ResponseWriter, r *http.Request) {
|
||||
}
|
||||
|
||||
func authorizeOAuthApp(c *Context, w http.ResponseWriter, r *http.Request) {
|
||||
authRequest := model.AuthorizeRequestFromJson(r.Body)
|
||||
if authRequest == nil {
|
||||
var authRequest *model.AuthorizeRequest
|
||||
err := json.NewDecoder(r.Body).Decode(&authRequest)
|
||||
if err != nil || authRequest == nil {
|
||||
c.SetInvalidParam("authorize_request")
|
||||
return
|
||||
}
|
||||
@@ -65,10 +67,9 @@ func authorizeOAuthApp(c *Context, w http.ResponseWriter, r *http.Request) {
|
||||
defer c.LogAuditRec(auditRec)
|
||||
c.LogAudit("attempt")
|
||||
|
||||
redirectUrl, err := c.App.AllowOAuthAppAccessToUser(c.AppContext.Session().UserId, authRequest)
|
||||
|
||||
if err != nil {
|
||||
c.Err = err
|
||||
redirectUrl, appErr := c.App.AllowOAuthAppAccessToUser(c.AppContext.Session().UserId, authRequest)
|
||||
if appErr != nil {
|
||||
c.Err = appErr
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
Ссылка в новой задаче
Block a user