Open kidandcat opened 4 years ago
Right, it's the toJWT
that raises. I guess we need an initialization method that wouldn't raise. Smth in lines of
var jwt: JWT
if jwt.init(p{"token"}.getStr) and jwt.verify(secret):
# all good
Feel free to file a PR. Or did you see it differently?
Could the
verify
method API be standarized?I mean, now it can return false or throw an exception, one thing should be possible only, if not this lead to duplicating checking code:
PD: if you agree I can make the PR, I'm opening this issue to know if I'm missing an existing good reason for this approach