fix: Fixes nil error while processing wrong jwt value. Fixes #10970
Co-authored-by: David Mišurec <david.misurec@icewarp.com>
This commit is contained in:
parent
a1d0111c1b
commit
40353cf762
|
@ -261,7 +261,7 @@ function Util:process_and_verify_token(session, acceptedIssuers)
|
||||||
pubKey = session.public_key;
|
pubKey = session.public_key;
|
||||||
elseif self.asapKeyServer and session.auth_token ~= nil then
|
elseif self.asapKeyServer and session.auth_token ~= nil then
|
||||||
local dotFirst = session.auth_token:find("%.");
|
local dotFirst = session.auth_token:find("%.");
|
||||||
if not dotFirst then return nil, "Invalid token" end
|
if not dotFirst then return false, "not-allowed", "Invalid token" end
|
||||||
local header, err = json_safe.decode(basexx.from_url64(session.auth_token:sub(1,dotFirst-1)));
|
local header, err = json_safe.decode(basexx.from_url64(session.auth_token:sub(1,dotFirst-1)));
|
||||||
if err then
|
if err then
|
||||||
return false, "not-allowed", "bad token format";
|
return false, "not-allowed", "bad token format";
|
||||||
|
|
Loading…
Reference in New Issue