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
import authService from 'auth-service-js';
const service = authService(http, 'http://localhost:3000');
service.getTokenByCookies({
BX_USER_ID: '111',
PHPSESSID: '222',
});
Refresh token
import authService from 'auth-service-js';
const service = authService(http, 'http://localhost:3000');
service.refreshToken(token);