Parse the HTTP authorization header.
npm install @borderless/parse-authorization --save
import { basic, bearer } from "@borderless/parse-authorization";
expect(bearer("Bearer 123")).toEqual("123");
expect(basic("Basic dGVzdDoxMjPCow==")).toEqual(["test", "123£"]);
This project is written using TypeScript and publishes the definitions directly to NPM.
MIT