Skip to content

Commit aadf7bc

Browse files
authored
Merge pull request #26 from mtte/master
Fix error when OAUTH_PUBKEY_PATH is not set
2 parents a38fec1 + e361e97 commit aadf7bc

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

lib/jwtverify.lua

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -274,13 +274,15 @@ core.register_init(function()
274274

275275
-- when using an RS256 signature
276276
local publicKeyPath = os.getenv("OAUTH_PUBKEY_PATH")
277-
local pem = readAll(publicKeyPath)
278-
config.publicKey = pem
277+
if publicKeyPath ~= nil then
278+
local pem = readAll(publicKeyPath)
279+
config.publicKey = pem
280+
end
279281

280282
-- when using an HS256 or HS512 signature
281283
config.hmacSecret = os.getenv("OAUTH_HMAC_SECRET")
282284

283-
log("PublicKeyPath: " .. publicKeyPath)
285+
log("PublicKeyPath: " .. (publicKeyPath or "<none>"))
284286
log("Issuer: " .. (config.issuer or "<none>"))
285287
log("Audience: " .. (config.audience or "<none>"))
286288
end)

0 commit comments

Comments
 (0)