passport-fast-jwt
Version:
Passport authentication strategy for JSON Web Tokens using Fast-Jwt with support for EdDSA algorithm among others
24 lines (23 loc) • 695 B
TypeScript
/**
* Parses an HTTP Authorization header value to extract the scheme and value.
*
* @param headerValue - The value of the Authorization header.
* @returns An object containing the scheme and value if the header is valid, otherwise null.
*
* @example
* parseAuthHeader("Bearer token123")
* // Returns: { scheme: "Bearer", value: "token123" }
*
* parseAuthHeader("Basic dGVzdDp0ZXN0cGFzcw==")
* // Returns: { scheme: "Basic", value: "dGVzdDp0ZXN0cGFzcw==" }
*
* parseAuthHeader(12345)
* // Returns: null
*
* parseAuthHeader("InvalidHeader")
* // Returns: null
*/
export declare const parseAuthHeader: (headerValue: unknown) => {
scheme: string;
value: string;
} | null;