UNPKG

vue-auth3

Version:

<p align="center"> <img src="./docs/public/icon.svg" width="180px"> </p>

24 lines (23 loc) 597 B
import { defineAuthDriver } from "../../chunk-FXCJLCDF.mjs"; import "../../chunk-MI2N2CU6.mjs"; // src/drivers/auth/bearer.ts var bearer_default = defineAuthDriver({ request(auth, options, token) { options.headers["Authorization"] = "Bearer " + token; return options; }, response(auth, { headers }) { const token = headers.Authorization || headers.authorization; if (token) { const i = token.split(/Bearer:?\s?/i); return i[i.length > 1 ? 1 : 0].trim(); } return null; } }); export { bearer_default as default }; //# sourceMappingURL=bearer.mjs.map