1.0.5 • Published 4 years ago

jwt-network v1.0.5

Weekly downloads
-
License
ISC
Repository
-
Last release
4 years ago

1、install from npm

npm i jwt-network

2、initialization

import Jwt from 'jwt-network';

const {JwtNetWork, JwtToken} = Jwt;

const token = new JwtToken();

const props = {
    contextUrl: 'https://127.0.0.1:8080/',
    jwtToken: token
};

const network = new JwtNetWork(props);

3、get token from server

const auth = () => network.fetchGet("/auth").then(rs => {
    token.setJwtToken(rs);
});

4、It can be used anywhere in your App

5、clearJwtToken

const logoutCallback = () => token.clearJwtToken();
1.0.5

4 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago