@foal/core
Version:
Full-featured Node.js framework, with no complexity
14 lines (13 loc) • 563 B
TypeScript
/**
* Verify a base64-encoded (or base64url-encoded) signed token against a secret.
*
* Returns false if the token format is invalid or the signature does not match.
*
* Returns the token without its signature otherwise.
*
* @export
* @param {string} signedToken - The signed token
* @param {string} secret - The base64-encoded secret with which the token is supposed to have been signed with.
* @returns {(string|false)} - False or the unsigned token.
*/
export declare function verifySignedToken(signedToken: string, secret: string): string | false;