Skip to content
This repository was archived by the owner on Feb 14, 2018. It is now read-only.

auth(): separate retrieval of bearer token from verification, so we c… #50

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions nginx-jwt.lua
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,10 @@ function M.auth(claim_specs)

-- require Bearer token
local _, _, token = string.find(auth_header, "Bearer%s+(.+)")
return M.auth_token(token, claim_specs)
end

function M.auth_token(token, claim_specs)
if token == nil then
ngx.log(ngx.WARN, "Missing token")
ngx.exit(ngx.HTTP_UNAUTHORIZED)
Expand Down