auth-service-js

1.0.0-rc.1 • Public • Published

Auth Service JS Client

Library for Auth JWT Service.

How to contribute

  • clone repository
  • install dependencies npm install
  • use npm run test:watch to run test with --watch mode
  • use npm run build to build library

Please, pay special attention: as far as we have a lack of abilities to publish private npm package for free to use auth-service-js please run npm link ../auth-service-js in your main project.

How to use

Autentificate user by Bitrix cookies

/*eslint-disable */
import authService from 'auth-service-js';
 
// initialize client with http client and base url, i.e. http://localhost:3000
const service = authService(http, 'http://localhost:3000');
// get JWT token
service.getTokenByCookies({
  BX_USER_ID: '111', // you should get BX_USER_ID from cookie
  PHPSESSID: '222', // you should get PHPSESSID from cookie
});
/* eslint-enable */

Refresh token

/*eslint-disable */
import authService from 'auth-service-js';
 
// initialize client with http client and base url, i.e. http://localhost:3000
const service = authService(http, 'http://localhost:3000');
// refresh JWT token
service.refreshToken(token);
/* eslint-enable */

Readme

Keywords

none

Package Sidebar

Install

npm i auth-service-js

Weekly Downloads

6

Version

1.0.0-rc.1

License

UNLICENSED

Unpacked Size

4.4 kB

Total Files

3

Last publish

Collaborators

  • yola-readonly