How to use the @nebular/auth/services/token/token.NbAuthJWTToken function in @nebular/auth

To help you get started, we’ve selected a few @nebular/auth examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github akveo / nebular / src / framework / auth / services / interceptors / jwt-interceptor.spec.ts View on Github external
describe('jwt-interceptor', () => {

  // tslint:disable
  const validJWTValue = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJjZXJlbWEuZnIiLCJpYXQiOjE1MzIzNTA4MDAsImV4cCI6MjUzMjM1MDgwMCwic3ViIjoiQWxhaW4gQ0hBUkxFUyIsImFkbWluIjp0cnVlfQ.Rgkgb4KvxY2wp2niXIyLJNJeapFp9z3tCF-zK6Omc8c';
  const validJWTToken = new NbAuthJWTToken(validJWTValue, 'dummy');
  const expiredJWTToken = new NbAuthJWTToken('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzY290Y2guaW8iLCJleHAiOjEzMDA4MTkzODAsIm5hbWUiOiJDaHJpcyBTZXZpbGxlamEiLCJhZG1pbiI6dHJ1ZX0.03f329983b86f7d9a9f5fef85305880101d5e302afafa20154d094b229f75773','dummy');
  const authHeader = 'Bearer ' + validJWTValue;

  let authService: NbAuthService;
  let tokenService: NbTokenService;
  let dummyAuthStrategy: NbDummyAuthStrategy;

  let http: HttpClient;
  let httpMock: HttpTestingController;

  function filterInterceptorRequest(req: HttpRequest): boolean {
    return ['/filtered/url']
      .some(url => req.url.includes(url));
  }

  beforeEach(() => {
    TestBed.configureTestingModule({
github akveo / nebular / src / framework / auth / services / interceptors / jwt-interceptor.spec.ts View on Github external
describe('jwt-interceptor', () => {

  // tslint:disable
  const validJWTValue = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJjZXJlbWEuZnIiLCJpYXQiOjE1MzIzNTA4MDAsImV4cCI6MjUzMjM1MDgwMCwic3ViIjoiQWxhaW4gQ0hBUkxFUyIsImFkbWluIjp0cnVlfQ.Rgkgb4KvxY2wp2niXIyLJNJeapFp9z3tCF-zK6Omc8c';
  const validJWTToken = new NbAuthJWTToken(validJWTValue, 'dummy');
  const expiredJWTToken = new NbAuthJWTToken('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzY290Y2guaW8iLCJleHAiOjEzMDA4MTkzODAsIm5hbWUiOiJDaHJpcyBTZXZpbGxlamEiLCJhZG1pbiI6dHJ1ZX0.03f329983b86f7d9a9f5fef85305880101d5e302afafa20154d094b229f75773','dummy');
  const authHeader = 'Bearer ' + validJWTValue;

  let authService: NbAuthService;
  let tokenService: NbTokenService;
  let dummyAuthStrategy: NbDummyAuthStrategy;

  let http: HttpClient;
  let httpMock: HttpTestingController;

  function filterInterceptorRequest(req: HttpRequest): boolean {
    return ['/filtered/url']
      .some(url => req.url.includes(url));
  }

  beforeEach(() => {