Skip to content

barktler/Mixin-Authorization

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Mixin-Authorization

Build Status codecov npm version downloads

🎆 Authorization Mixin for Barktler

Install

yarn add @barktler/mixin-authorization
# Or
npm install @barktler/mixin-authorization --save

Bearer Authorization

import { createBearerAuthorizationMixin } from "@barktler/mixin-authorization";
import { YourAPI } from "somewhere";

const api: YourAPI = new YourAPI();
api.useMixin(createBearerAuthorizationMixin({
    getTokenFunction: async () => getYourToken(),
}));

Basic Authorization

import { createBasicAuthorizationMixin } from "@barktler/mixin-authorization";
import { YourAPI } from "somewhere";

const api: YourAPI = new YourAPI();
api.useMixin(createBasicAuthorizationMixin({
    getTokenFunction: async () => getYourToken(),
    base64: true, // default true, false for not encode
}));

Documents

See Barktler Documents.

About

🎆 Authorization Mixin for Barktler

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published