Add more OAuth unit tests (#5946)
Этот коммит содержится в:
10
api/oauth.go
10
api/oauth.go
@@ -901,11 +901,6 @@ func deauthorizeOAuthApp(c *Context, w http.ResponseWriter, r *http.Request) {
|
||||
params := mux.Vars(r)
|
||||
id := params["id"]
|
||||
|
||||
if len(id) == 0 {
|
||||
c.SetInvalidParam("deauthorizeOAuthApp", "id")
|
||||
return
|
||||
}
|
||||
|
||||
// revoke app sessions
|
||||
if result := <-app.Srv.Store.OAuth().GetAccessDataByUserForApp(c.Session.UserId, id); result.Err != nil {
|
||||
c.Err = result.Err
|
||||
@@ -946,11 +941,6 @@ func regenerateOAuthSecret(c *Context, w http.ResponseWriter, r *http.Request) {
|
||||
params := mux.Vars(r)
|
||||
id := params["id"]
|
||||
|
||||
if len(id) == 0 {
|
||||
c.SetInvalidParam("regenerateOAuthSecret", "id")
|
||||
return
|
||||
}
|
||||
|
||||
var oauthApp *model.OAuthApp
|
||||
if result := <-app.Srv.Store.OAuth().GetApp(id); result.Err != nil {
|
||||
c.Err = model.NewLocAppError("regenerateOAuthSecret", "api.oauth.allow_oauth.database.app_error", nil, "")
|
||||
|
||||
Ссылка в новой задаче
Block a user