@aikidosec/firewall
Version:
Zen by Aikido is an embedded Web Application Firewall that autonomously protects Node.js apps against common and critical attacks
14 lines (13 loc) • 403 B
TypeScript
/**
* This function tries to decode your input as if it is a JSON Web Token, if it fails to do so it returns {jwt: false}.
* @param jwt A (possible) JWT
* @returns The JWT if it's valid, otherwise it returns false
* @example
* tryDecodeAsJWT("invalid"); // Returns {jwt: false}
*/
export declare function tryDecodeAsJWT(jwt: string): {
jwt: true;
object: unknown;
} | {
jwt: false;
};