diff --git a/src/service/oauth/oauth.lua b/src/service/oauth/oauth.lua index 471b93d..4bfa51a 100644 --- a/src/service/oauth/oauth.lua +++ b/src/service/oauth/oauth.lua @@ -139,9 +139,10 @@ local function authorizateCode(args) -- 1.校验必填参数验证数据是否符合json local ok = validator.validateToken(args) if not ok then - resp:response(status.TOKEN_INVALID) + resp:response(status.PARAM_IS_INVALID) return end + print("consume code:", args.code) -- 2.校验 code 有效性 local code_data, err = authcode.consume(args.code)--, args.client_id) if not code_data then @@ -234,6 +235,9 @@ end function _M:token() -- 1. 解析请求参数(支持 form-data 和 json) local args = getUriArgs() + if args == nil then + ngx.exit(ngx.HTTP_BAD_REQUEST) + end local grant_type = args.grant_type --print("grant_type类型: ", grant_type) if grant_type == "password" then