pgjwt icon indicating copy to clipboard operation
pgjwt copied to clipboard

token invalid states

Open ReinsBrain opened this issue 6 years ago • 0 comments

Im excited to make use of pgjwt in our applications but I'd like to be able to be more informative regarding invalidation of a jwt. The invalid exceptions in JWT that Im aware of are:

JWT_CREDS_BAD_SCHEME
JWT_CREDS_BAD_FORMAT,
JWT_UNSUPPORTED_ALGORITHM,
JWT_TOKEN_NOT_ACTIVE,
JWT_TOKEN_EXPIRED,
JWT_SIG_VERIFY_FAILED,
JWT_CORRUPT,
JWT_PAYLOAD_CORRUPT

Do you think it might be valuable to include a 4th (and possibly 5th) column in the returned set from the verify function, perhaps called invalid_code (and invalid_message) which could return the cause of invalidation?

ReinsBrain avatar Jan 09 '19 17:01 ReinsBrain