Represents the various errors that can be returned when parsing or creating JSON Web Tokens. This can be useful to create proper responses to HTTP requests that included a token.
| 30 | // creating JSON Web Tokens. This can be useful to create proper |
| 31 | // responses to HTTP requests that included a token. |
| 32 | class JWTError : public Error { |
| 33 | public: |
| 34 | enum class Type { |
| 35 | INVALID_TOKEN, // Invalid token. |
| 36 | UNKNOWN // Internal error/all other errors. |
| 37 | }; |
| 38 | |
| 39 | JWTError(const std::string& message, Type _type) |
| 40 | : Error(message), type(_type) {}; |
| 41 | |
| 42 | const Type type; |
| 43 | }; |
| 44 | |
| 45 | |
| 46 | /** |