Skip to content

Commit b9fd68e

Browse files
committed
make check a bit more robust
Signed-off-by: Stefan Bodewig <stefan.bodewig@innoq.com>
1 parent 7bb2413 commit b9fd68e

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

lib/resty/openidc.lua

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -583,8 +583,11 @@ end
583583

584584
-- make a call to the userinfo endpoint
585585
function openidc.call_userinfo_endpoint(opts, access_token)
586-
openidc_ensure_discovered_data(opts)
587-
if not opts.discovery.userinfo_endpoint then
586+
local err = openidc_ensure_discovered_data(opts)
587+
if err then
588+
return nil, err
589+
end
590+
if not (opts and opts.discovery and opts.discovery.userinfo_endpoint) then
588591
log(DEBUG, "no userinfo endpoint supplied")
589592
return nil, nil
590593
end

0 commit comments

Comments
 (0)