mirror of
https://github.com/arun11299/cpp-jwt.git
synced 2025-05-15 09:18:33 +00:00
Put verify under different function. Added new error codes for verification failures.
This commit is contained in:
parent
912e4b5ff9
commit
7a511c46fe
7 changed files with 204 additions and 30 deletions
|
@ -33,6 +33,17 @@ enum class DecodeErrc
|
|||
DuplClaims,
|
||||
};
|
||||
|
||||
/**
|
||||
*/
|
||||
enum class VerificationErrc
|
||||
{
|
||||
InvalidAlgorithm = 1,
|
||||
TokenExpired,
|
||||
InvalidIssuer,
|
||||
InvalidAudience,
|
||||
ImmatureSignature,
|
||||
};
|
||||
|
||||
/**
|
||||
*/
|
||||
std::error_code make_error_code(AlgorithmErrc err);
|
||||
|
@ -41,6 +52,10 @@ std::error_code make_error_code(AlgorithmErrc err);
|
|||
*/
|
||||
std::error_code make_error_code(DecodeErrc err);
|
||||
|
||||
/**
|
||||
*/
|
||||
std::error_code make_error_code(VerificationErrc err);
|
||||
|
||||
} // END namespace jwt
|
||||
|
||||
|
||||
|
@ -55,6 +70,9 @@ namespace std
|
|||
|
||||
template <>
|
||||
struct is_error_code_enum<jwt::DecodeErrc>: true_type {};
|
||||
|
||||
template <>
|
||||
struct is_error_code_enum<jwt::VerificationErrc>: true_type {};
|
||||
}
|
||||
|
||||
#include "jwt/impl/error_codes.ipp"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue