diff --git a/ChangeLog b/ChangeLog index 83746b7..5b5fcb5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +03/06/2019 +- don't overwrite opts.discovery when an error occurs calling the + discovery endpoint; see #250 + 02/18/2019 - release 1.7.1 diff --git a/lib/resty/openidc.lua b/lib/resty/openidc.lua index 7ebfe48..71333ab 100644 --- a/lib/resty/openidc.lua +++ b/lib/resty/openidc.lua @@ -586,8 +586,12 @@ end local function openidc_ensure_discovered_data(opts) local err if type(opts.discovery) == "string" then - opts.discovery, err = openidc_discover(opts.discovery, opts.ssl_verify, opts.timeout, opts.jwk_expires_in, opts.proxy_opts, - opts.http_request_decorator) + local discovery + discovery, err = openidc_discover(opts.discovery, opts.ssl_verify, opts.timeout, opts.jwk_expires_in, opts.proxy_opts, + opts.http_request_decorator) + if not err then + opts.discovery = discovery + end end return err end